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

Calculate variable once in summary

edited September 2009 in General
Hi,

In a big, multi level report a few variables are calculated in subreports
and displayed in the summary band of the main report. In this summary band I
also calculate some additional variables partly based on these other
variables. Because this calculation is 'heavy' I want to calculate it only
once and set the timing to ReportEnd. However this seems to late because the
base variables are already reset.

What timing can I use?

Regards,
Jeroen.

Comments

  • edited September 2009
    Hi Jeroen,

    The TppVariables are not really designed to calculate only once. The
    ReportEnd calculation will call the OnCalc event after the report has
    finished, so nothing already printed is changed.

    Although I cannot recommend this for every calculation, you might try
    playing around with other variable events such as the OnPrint or
    OnDrawCommandCreate. Since these variables are inside the Summary band,
    they should only fire once and may be usefull in updating the other
    variables' values.

    The only other option I can think of is to determine when the last traversal
    of the dataset will be beforehand, then create a condition inside the OnCalc
    of the variable based on that value. This however may take more resources
    than making the calculation numerous times like you currently are.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.