Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Cumulative Evaluations in a sub report detail band

edited March 2004 in General
Ok, let's see if I can write this out clearly...

I have a report that contains a subreport in the detail band. The report
has a group header and footer, title and summary.

The Subreport contains ONLY a detail band. In the subreport's detail band,
I have a global variable that does gathers a cumulative sum from a field in
the subreport. This sum is used as information for my footer in the main
report.

Now - here's my problem...

The detail band's event's in the subreport are called everytime the
page is changed while previewing the report. SO... the calculations can
happen over and over everytime you go back and forth between pages leaving
me with incorrect calculations.

Is there a simple way around this? Something that fixes the number
once the report has been genereated the first time so that I can walk thru
my pages and not worry about losing my calculations? Or, should I just set
my own boolean telling me that the calculation has been done in the event so
as to not have it run the contents of my event again?

Please, let me know if you've encountered this problem and your
solution.

Tyler

Comments

  • edited March 2004
    Hi Tyler,

    The easiest way around this is to set the Report.CachePages to True. Note
    that this will take up more memory resourses as each page is being cached in
    memory once it is generated but it should not be an issue unless you have
    large images on each report page.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    That's great! It only leaves me with one more problem.

    As I go from previewing to printing, it doesn't print off the cached pages.
    It recalculates the report again, thus throwing off my totals.

    Tyler

This discussion has been closed.