cancel
Showing results for 
Search instead for 
Did you mean: 

Subreports blank when previewed from main report, populated when viewing separately

Former Member
0 Kudos

Hello. I am having trouble getting subreports to display properly. When in Print Preview for the main report, the subreports are blank. However, when double-clicking the subreport in Print Preview, the Print Preview for the subreport opens, and everything is displayed properly. This appears to be caused by linking the subreport parameter to the main report using a formula. I just don't understand why it displays properly when opening the subreport. I have also tried changing the formula. When I simply input the design parameter as a string instead of calculating and returning a value, everything seems to work. It's only when trying to perform the calculation that it fails. I have also checked the value being returned by the formula, and it is correct (otherwise the values in the Print Preview for the subreport would be wrong). If anyone can offer any insight, I would greatly appreciate it.

Thanks,

Trace Tidwell

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Trace,

Formula might be wrong please verify that one and use shared variable from subreport to main report.

Thanks,

DJ

Former Member
0 Kudos

I don't believe the formula is wrong. When checking, it returns the correct value. It also works when opening the subreport Print Preview. I don't think this would be the case if the formula were wrong. I also don't quite understand what you mean about using a shared variable from subreport to main report. I don't think I can set my parameters using variables. Can you please elaborate?

Thanks,

Trace

Former Member
0 Kudos

Trace,

One suggestion Right click on subreport in main report -> change subreport links -> then ok

or

reimport subreport freshly then check the data once

Need more explanation regarding perform calculations that it be fails. Provide any screenshots more helpful.

Thanks,

DJ

abhilash_kumar
Active Contributor
0 Kudos

Hi Trace,

I remember being involved in a discussion where the user had the same issue however, I can't locate that thread!

What version of CR are you using with the Service Pack/Patch?

I think this was a known issue with one of the versions of CR where the Subreport would only show up when drilled into (I might be wrong though).

-Abhilash

Former Member
0 Kudos

I have Crystal Reports 2008 Version 12.0.0.683. Where do I find what Service Pack I'm running?

Thanks,

Trace

abhilash_kumar
Active Contributor
0 Kudos

Well, that's the very first version of CR and it is bound to experience bugs.

I would recommend upgrading to the highest Service Pack + Patch available for Crystal Reports and try refreshing the report again.

If you have an S-User ID, you can logon to the Service Market Place and download the latest version from there.

If you don't, then download SP4 from the link in this Wiki:

Crystal Reports 2008 - Version and Download information for SPs and FPs - Business Intelligence (Bus...

-Abhilash

Former Member
0 Kudos

Trace,

Helpful thread :

Thanks,

DJ

abhilash_kumar
Active Contributor
0 Kudos

To avoid confusion, the thread posted by DJ has absolutely Nothing to do with the issue being reported by Trace here.

-Abhilash

Former Member
0 Kudos

Hi Trace,

i would like to know is that issue happening with single report or all the reports?

if it happen for all the reports better you can follow abhilash suggestion, if it happen with single report try to create a sample report with sub report and test the issue.

--Naga.

Former Member
0 Kudos

Trace,

Any updates................

Regards,

DJ

Former Member
0 Kudos

Hello. I apologize for the delayed response. This is a work computer, so all updates must be installed by IT. Needless to say, it's taking them a while to get to it, but I expect to have all the service packs installed soon. Perhaps it will help. I also realized I probably should have elaborated more on the problem. I need to be able to create parameters from records to be passed to subreports. I placed a formula with the following code in the report header:

WhilePrintingRecords;

Shared StringVar Array bom;
Shared NumberVar index := 0;

From there, I created a subreport containing the following formula in the details section:

WhilePrintingRecords;

Shared StringVar Array bom;
Shared NumberVar index;

index := index + 1;
ReDim Preserve bom[index];
bom[index] := {GetProjectInfo.DESIGN};

I have then created formulas (bom[1], bom[2],...) and linked them to the subreports as parameters. It is at this point that the problem arises. I can only view the subreports when drilling down into them. My guess is that is has something to do with WhilePrintingRecords, though I'm not certain. When changing the formulas that link to the subreports to simply be the value (e.g. "V601220A" instead of bom[2]), the subreports are visible in the main print preview. Has anyone had any experience with this? Is there a better way to pull a single record from a field to be used as a parameter in a subreport?

I appreciate all the feedback. Hopefully someone smarter than I has come across this before!

Trace