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!

Suppress Subreport based on shared variables

Status
Not open for further replies.

khan82

Technical User
Feb 23, 2012
57
CA
I have two sub reports that are passing variables to the main report. How can i hide one of the subreport if the result is the same as the first subreport?

Bothe the shared variables have a number value and some instances its the same. I don't want to reprint the same section twice on one page.

i tried the suppress formula in the main report under formatting subreport but i dont think its evaluating the shared variables correctly, so it didn't work.

Thanks
Khan82
 
The problem is that the result of the shared variable from the second sub report won't be available in the main report until the section below the sub report, by which time it is too late to suppress it.

The simplest way, which may or may not work depending on the structure of the second sub report would be to pass the value of the shared variable from the 1st sub report to the 2nd, and suppress all sections of the second subreport if the results match. It would then be a simple matter of formatting the second sub report to suppress the blank sub report.

If this option isn't available because of the basis of the calculation in the 2nd sub report, the only way I could see to do it would be to repeat the 2nd sub report in a section before the 1st before the first but hidden (suppress all rows, format sub report to suppress if blank, and format section to suppress if blank). This would allow the result of the second sub report to be available to enble conditional suppreesion of the 'main' instance of the 2nd sub report.

Hope all this makes sense.

Cheers
Pete
 
so the first report is in GH 1b while the second one is in GH 1C

I was able to pass the variable for the first subreport to the second by creating the formula:

whileprintingrecords;
shared numbervar min;

The only problem is that when i set the formula in section expert under the subreport...it doesn't seem to be working for the detail section or the group header but only for the report footer section.
 
Sorry, I don't understand. Did you follow the earlier instructions?

What is the formula to calculate the Max variable in the second sub report?

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top