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

Global Variables

edited April 2004 in General
Hello,

I am using RB 7.03.

I have a report that contains a subreport. The subreport has a DBCalc field
in the summary section which I need to sum up and print the totals in the
main report. I created a global variable and assigned the dbcalc field to
the global variable. Then added a Variable in the main report and assigned
the global variable value to it.

The value of the variable in the main report does not calculate correctly -
it doubles the amount. Any suggestions on what I can do in this case?

Thanks,
Yelena

Comments

  • edited April 2004
    Hi Yelena,

    When calculating grand totals, it is best to manually create your sums using
    TppVariables rather than DBCalc components. My suggestion would be to place
    a TppVariable in the detail band of your subreport and in its OnCalc event,
    update the values of a variable inside the summary section of the subreport
    and another TppVariable (which has a global variable assigned to it) in the
    summary of the main report. Be sure to set the timing of each variable so
    they reset at the correct time.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2004
    I put a variable in the detail section of the subreport with the following
    onCalc function.

    gVaraible1.Value := gVariable.Value + PipeSub1['Price'];

    This is doubling the totals as well. The total should be $33.50 however, the
    global variable is displaying $67.00.

    Am I doing what you suggested?

    Thanks,

    Yelena






  • edited April 2004
    Hi Yelena,

    This should not calculate twice. Be sure you have your timing set correctly
    on your TppVariable. Take a look at the following example oh how to use the
    RAP Global Variables to get a grand total from a subreport. If you still
    cannot get yours working, please send a small example of the problem to
    support@digital-metaphors.com and I'll take a look at it for you.

    http://www.digital-metaphors.com/tips/RAPGrandTotalInHeader.zip

    --
    Best Regards,

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