cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting records in subreport

dave_smith2
Participant
0 Kudos

Using SAP Crystal runtime for .NET 13.0.17.

We have been unsuccessful in being able to detect whether or not a subreport is returning records on a consistent basis. The scenarios are:

  1. Report consisting of only subreports and no main report
  2. Report consisting of both main and subreports
  3. Reports with and without parameters

We have seen the discussions and , but are not able to properly use the SDK to determine whether a report containing subreports is empty or not.

We have used both the subReport.HasRecords and subReport.Rows.Count properties, but none seem to work consistently. Is there a foolproof method to determine this for all the above scenarios?

The problem does not seem to occur with main reports, using reportDocument.Rows.Count.

Any assistance would be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

OK so in my Parameter test app if you set this:

    int subreportLinkValue = 0;

to this:

    string subreportLinkValue = "1003";

And then look for this line in the Log on routine:

subreportClientDocument.DataDefController.ParameterFieldController.SetCurrentValue(crSubreportObject.SubreportName.ToString(), trimCurlies.ToString(), subreportLinkValue);

Then after setting the log on info and using a value that is expected for that report you will get the count:

The problem is I can't find a way to get the value CR uses for a linked subreport parameter so I have to ping DEV and see if they know of a way...

Don

dave_smith2
Participant
0 Kudos

Thanks Don.

We will look into this.

What about the scenario where the report does not contain any parameters? Also, I am not able to find your KBA 2281780. I tried the suggested search



http://search.sap.com/#query=2281780

and nothing was returned.

0 Kudos

Hi Dave,

Ah yes, forgot to test that.

It does not need to be logged on to get the subreport record count because there is no parameter linking the main report to the subreport. No parameter to fill data with so it returns the count.

There may be another way, I'll have a look at it tomorrow...

Don

dave_smith2
Participant
0 Kudos

OK, thanks.

Would you be able to provide a link to your KBA? I am not able to find it when searching on the site.

0 Kudos

I have not written it yet, I need to get feed back from DEV first, they may say it is a limitation, by design or ask me to escalate as an Enhancement request.

DEV is busy right now finalizing CR for VS SP 18 and BOE SP 9 so they can't look at it right now.

By end of week we may get an update...

Don

Answers (1)

Answers (1)

0 Kudos

Hi Dave,

Working on it.... I can set the value just trying to find a way of getting the value...

It's in my Parameter test app in KBA 2281780.

Don