Skip to Content
author's profile photo Former Member
Former Member

Subreports using stored procedure within a main report using a resultset

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Sep 09, 2013 at 05:00 PM

    Hello Nicolas

    I don't work with the Java SDK, but ocasionally peek in here as the forums does not have a dedicated Moderator.

    Anyhow, from a high level perspective, I suspect that the reason for the issue is that the resultset does not match what the report engine is expecting, based on the original report design. I think this may be similar to dataset issues that I see with the .NET SDK and I wrote a small blog on how to troubleshoot these issues:

    http://scn.sap.com/community/crystal-reports-for-visual-studio/blog/2009/03/02/troubleshooting-issues-with-vs-net-datasets-and-crystal-reports

    Have a look at the blog, it may lead you to a solution,

    - Ludek

    Senior Support Engineer AGS Product Support, Global Support Center Canada

    Follow us on Twitter

    Got Enhancement ideas? Try the SAP Idea Place

    Share Your Knowledge in SCN Topic Spaces

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.