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

Sub report Totals

edited November 2003 in RAP
Hi list,
i've a report with a sub report and i've to calculate the totals of a
subreport field.
i've dropped on the sub report detail's band subvariable1, set visible to
false.
In the MainReport.calc page, Module section i've created a variable:
totordine: double;
In the oncalc event of the subreport subvariable1 i've coded:
totordine := totordine + RDO['TOTALE']; // totale is a calculated field
In the main report's summary i've dropped genvariable1 and in the oncalc
event i've coded:
value := totordine;
but when i see the report wrong values appears in the genvariable 1.the
report doesn't calculate the last value of the subvariable1.
If i see again the report another value is dislpayed.

Any help appreciated

Paolo Fenelli

Comments

  • edited November 2003

    In the main report's code module, declare a global like this:

    var
    gMainTotal: TppVariable;

    In the main report's code module global OnCreate initialize the object
    reference:

    gMainTotal := genVariable1;

    In the subreport's OnCalc use the gMainTotal

    gMainTotal := gMainTotal + RDO['Totale"];



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2003
    Hello,
    thanks it work ( naturally You mean gMainTotal.value := gMainTotal.value +
    RDO['Totale"];

    Best rgds.
    Paolo Fenelli
This discussion has been closed.