on 09-08-2014 9:33 PM
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
Hello Trace,
Formula might be wrong please verify that one and use shared variable from subreport to main report.
Thanks,
DJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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:
-Abhilash
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.