cancel
Showing results for 
Search instead for 
Did you mean: 

How does subreport handle no data?

Former Member
0 Kudos

Hi,

I'm passing 2 parameters to a subreport and trying to display the parameter values within the subreport.

I notice that if the subreport returns no data, the parameter values do not appear. They only appear if there is 1 or more record(s) returned in the subreport. Is there a way to force the parameter values to always appear regardless of the number of records returned?

Placement of the parameters doesn't seem to matter. I've tried them in the header, detail, footer and all seem to be behaving the same way.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try with Shared variable in formulas,

Steps,

1, Create a new formula in main report,

2,Initialize one Shared variable and assign the parameter value into it.

eg. Shared stringvar XYZ;

XYZ := ParamValue;

3, save the formula

4, same way create another formula in subreport and use the same shared variable into that and pass the value(imp: use same variable name(XYZ) in both formulas).

eg. Shared stringvar XYZ;

XYZ;

5, Save it and drag and drop into the subreport.

cheers.

Hope this will help,

regards,

salah

Former Member
0 Kudos

Hi salah,

I tried your suggestion exactly and I get the same results: the shared variables do not appear if the subreport returns 0 records.

Is there another alternative to force the variables to appear even if no recrods are returned in subreport?

Thanks

Former Member
0 Kudos

Hi,

Sorry, i forgot to tell you one thing,

Drag and Drop that formula field(Main report) to anywhere in the main report.

then suppress that field.(Right click-Common tab-check Suppress).

Run the report

Once you are getting the same problem again, delete the whole subreport links(if exists).Run the report then let me know the result.

Regards,

salah

Former Member
0 Kudos

Hi Salem,

That worked!

I had to delete the subreport and start over. I think with all my chages to it and the links, Crystal got mixed up internally.

Thank you for all your help.

Fishchi

Answers (0)