Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding passed values from subreport

Status
Not open for further replies.

Barock21

MIS
Dec 27, 2005
23
0
0
US
I am on crystal 8.5 and I am trying to pass a total value that is on a subreport to the main report. I was able to do so sucessfully. I have the subreport in a section before the value that I want to show on the main report (detail section) and have the passed total value in report footer.

This actually causes a problem since I only care about the total value of the subreport. In the mean time, now I end up with all this detail info from the subreport showing up. I tried to hide the section where the subreport resides but this results in the total being passed be 0.

Any advice? Thx.
 
Do you use a Shared Variable?

You could just make the subreport itself invisible and show the section itself. That way maybe the value won't revert to zero?
 
You can suppress all the sections within the subreport and then minimize the height of the subreport, but you can't hide or suppress the section that it is in or the shared variable won't work. For further help you should provide the group structure of the main report and indicate where the subreport is located, and where you need the subreport value. You say you show the value in the detail section, so is it repeating there? If you have only one detail per group, consider adding the subreport to the detail section and displaying only the subreport report footer.

-LB
 
In Crystal 8.5, the subreport is evaluated after the rest of the section, and after the decision that the section should be printed or suppressed. Crystal 9 added an option to suppress blank subreports. For Crystal 8.5, you can use a work-round:
a) Copy the subreport
b) Place the subreport in some higher section, and make it as small as possible.
c) Use Shared Variables to pass back a value, that will indicate whether or not the subreport should be suppressed.
d) Use this returned value to determine whether or not to suppress the main copy of the subreport.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you all for your reply.

Yes, I'm using the shared variable function to do this. Currently there is no group on the main report only the usual report header, page header, detail, report footer and page footer. I have a static text on the report footer and the total for whatever information I have on the detail section. Now, I need a total of this subreport to be on the report footer also. So I used the shared variable and I put the subreport onto the detail and have the shared variable formula on the report footer and that's when this subreport keeps printing. At the end I just need this 1 line of information on the report footer. I don't even need the information on the detail of the main report.

Thanks guys.
 
Try inserting the subreport in a report header_b section instead of the detail section. Then format report header_a section to "underlay following section". Then suppress all sections within the subreport, and the space for the subreport will disappear under the report header_a where presumably you will have the report title.

-LB
 
LB it worked perfectly. You are the best!!!
Thanks a lot.

DT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top