Subreport Shared Variable Issue

I am working on a report that has 3 sub reports in it, for 2 of them I don't actually want anything to print on the main report. I just want to use some shared variables I have set up. The report is exhibiting some really strange behavior, if the sub-reports are set to hide the sections with data in them (not suppress) then I get an inaccurate # in my shared numbervar. If I un-hide everything and then report is not allowed to grow, I get an inaccurate # in the shared numbervar. The only way I can seem to get accurate numbers is if I show everything on the subreport and allow it to grow.

I checked and suppress blank sections is not checked off in that section, I can turn all the font white so that the data isn't actually showing but it still requires me to allow the subreport to be at full size which creates these large and unwanted spaces between sections. I swear I have been able to do this before and I believe there is a difference between suppressing the sections in the subreport and hiding them but I have never had it make me allow the subreport to grow to full size. Any thoughts?

  • I often suppress everything in sub-reports except for a report header / footer, and it passes through global variables just fine. I've even found a way (IIRC, a combination of suppress blank sub-report, and suppress blank section, with no data fields visible in the printable space) to completely avoid any consumed space in the output, while still allowing the global variables to function. The sub-report has to run, so you can't blanket suppress / hide the section. I believe the "blank" conditions require the sub-report to run before determining the output will be blank, so the global var's are calculated, then the output suppressed.
  • in reply to Kevin M
    Kevin,

    That seems to have fixed it!

    I have suppressed everything on the sub-report except for the report header and footer which contain no fields. Verified that within the sub-report report options that Suppress Printing If No Records is checked, within the sub-report properties on the Common tab accessed through the main report I have unchecked Can Grow and under the Subreport tab I have checked Suppress Blank Subreport. Also, within the section expert for the section the sub-report is located in I have checked off Suppress Blank Section.

    With all that done it seems to be working as desired, thanks for the response!