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

How to? multiple total variables in summary

edited June 2006 in General
We have a report detailing the following:
Account , Transaction Type, Transaction no., Currency, value
the data is grouped by account and transaction type / number.
what we need to display in the group cummary is a list of totals by currency
and also a summary total in the footer so we get the following:

A/C one
Debit 3 STG 100
Credit 5 Eur 50
Debit 6 STG 125

Stg Total 225
Eur total 50

A/C Two
Debit 1 Eur 125
Debit 2 STG 100
Credit 4 Eur 50

Stg Total 100
Eur total 175

Summary total
Stg Total 325
Eur total 225

There may be multiple currencies so how can we get the group footer to show
multiple totals (one for each currency)?

Comments

  • edited June 2006
    Hi Paul,

    Two options.

    1. Place two TppVariables in your group footer, and in the OnCalc event of
    each variable, increase the total sum based on the current field value.

    2. Place an invisible TppVariable inside the Detail band and use its OnCalc
    event to manage the value of other TppVariables located elsewhere in your
    report. For instance... (ppVariable2 and ppVariable3 are located in your
    group footer band.

    begin

    ldAmount := Report.DataPipeline['Value'];

    if Report.DataPipeline['Currency'] = 'STG' then
    ppVariable2.Value := ppVariable2.Value + ldAmount
    else
    ppVariable3.Value := ppVariable3.Value + ldAmount;

    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2006
    That is fine if there is only two currencies (e.g. Stg and Eur) but what if
    there is a dozen? What we need is to have an array type variable and to be
    able to print the array in the summary.

  • edited June 2006
    Hi Paul,

    There is no built-in feature to do this in ReportBuilder however it would be
    possible to dynamically create and place multiple TppVariables based on how
    many you need before the report is printed. This may be a matter of
    traversing your data before hand and creating an array of each separate
    currency type and using that information to assign the value of each
    dynamically created variable.

    --
    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.