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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using shared variable from subreport in main report

Status
Not open for further replies.

kimrose

MIS
Apr 15, 2005
11
US
I am trying to suppress a section when a value from my main report and a value from my subreport are equal to zero.

Main Report
GH1 Store
GH2 Product Type
GH3 Product ID

GF1 Store subtotals
GF2 Product Type subtotals

For each header I have totaled my sales from the main report and inserted QOH (quantity on hand) from my subreport. Everything displays fine. For GH3, in the instance where the sales and QOH equal zero I would like to suppress the line.

After reviewing dozens of posting, I'm still not sure what to do...

Do I put my grouped data in the GFs?
Insert the subreport in my GHs?
Reset the shared variable from my subreport in the page header?

I have tried this and it works, but I'm left with the subreport in the GH when I want to display it on the same line as the rest of my data (GF). I can put the shared variable on the same line (GF) instead of the subreport, but then I'm left with my subreport sitting up in the GH and can't shrink the section.

I think I'm making a mountain out of a mole hill. Any suggestions?
 
Subreport variables aren't usable until the next section: that's a fixed rule. As for group totals, a summary total will be available in the header, but a running total will 'run' and not be complete till the footer.

Right-click on a field and choose Insert to get a choice of Running Total or Summary. The problem with summary totals is that they can't be conditional in the way that Running totals are.

Other solutions depend a bit on which Crystal you are using. You can suppress a section if the subreport is blank, if you have Crystal 9 or higher. In Crystal 8.5 there is a fiddly work-round involving using the subreport twice.

Subreports can be made tiny - you select them from the main report and change the font to something tiny. And in the subreport, make sure there is no visible output.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Thank you Madawc! I think I just needed you to simplify for me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top