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!

Can I suppress a detail line based on value passed back from subreport

Status
Not open for further replies.

SBendBuckeye

Programmer
May 22, 2002
2,166
US
I have a report that has a subreport on the detail line. The subreport does a lot of ugly cost calculations and then prints the cost data on the main report. There are certain situations which cause the cost data to be zero.

My users would like to suppress detail lines with zero cost. How can I do this? I have tried setting up a shared boolean variable called ZeroCost. I set it to False and then have the Subreport set it to True, but how do I force it to be evaluated after the Subreport has run.

Any help or suggestions would be greatly appreciated!
 
I have subreports that sometimes return no records. However, even if the subreport returns no records, there is a text variable in the subreport header; hence, the subreport will display even if it has no content. To get around this problem, I conditionally suppress the header of the subreport if the distinct count of records is zero. I also suppress the actual details line in the subreport if there is no data. Then, in the main report, I only have to suppress if the footer holding the subreport is blank.

This technique might work for you. If the subreport returns no records, or returns a zero value, then try suppressing all of the text variables, etc. if the value is indeed zero. Then in the main report, suppress if the subreport is blank.

This might work, and it certainly is quick and easy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top