Skip to Content
0
Former Member
Sep 05, 2013 at 03:24 PM

Subreports using stored procedure within a main report using a resultset

103 Views

Hello,

I'm using Crystal Report Java SDK for simple report and report with subreports.

When I use store procedures for my main report and my subreports, everything is fine, the process is "automatic".

But when I use the same main report with a resultset and still stored procedures for my subreports I'm facing some "problems".

The thing is I have to set each parameters of each subreport... But I'm trying to do it in a generic way and I want to fetch each link between main report and subreport and to set subreport parameters with the right values.

1) When I loop on the SubreportLinks for a given subreport, I only have half of the attributes : the report side.

SubreportController subreportController = clientDoc.getSubreportController();

SubreportLinks links = subreportController.getSubreportLinks(subreportName);

I can't do anyhting without both side. So I'm wondering why i only have one side and if I do it the right way...

2) If the report parameter of my SubreportLink object is a ParameterField, I don't have anything at all

Facing this issue, I'm trying to do in a different way.

I'm using a resulset in input because I want to generate a report only if I have data in my ResultSet.

So, using a stored procedure for main report and subreports, the normal way, how can I know if the report ResultSet is empty or not ?

Or, is there a way not to generate the report is empty ? A counter ?

If I use :

clientDoc.getRowsetController().getRowsetBatchSize();

I always get "100", the default value.

But if I refresh the controller before getting the rowset batch size, I have an exception : "parameters are empty".

clientDoc.getRowsetController().refresh();

clientDoc.getRowsetController().getRowsetBatchSize();

Could someone help me solving this issue ?

Thank you,

Nicolas