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

help with ppVariable

edited September 2003 in General
Hello,

Were can I get some guidance about the ppVariable component. I have been
playing around with the CalcComponent, CalcType, ResetComponent, and
ResetType properties and cannot get the desired results.

Group Header
Detail Variable1
Group Footer Variable2
Summary Variable3

Variable1 is working great, it is adding up columns in the detail band. I
would like Variable2 to have the sum of Variable1 and reset for the next
group. I would like to have Variable3 to have the sum of Variable2 and reset
at the end of the report. How do I need to set the properties to accomplish
this.


Thanks in advance

Comments

  • edited September 2003
    Hi Gary,

    When calculating Variable2, be sure you are using the OnCalc event of
    Variable1. Then you can set Variable2's Timing property to reset on
    GroupEnd and define which group you would like to use. You can access the
    timing dialog by right clicking over the variable and selecting the Timing
    pop-up menu option.

    It also looks like Variable3 is a grand total so this calculation can also
    be done in the OnCalc event of Variable1 with it resetting on ReportEnd.
    Here is a quick example:

    procedure TForm1.Variable1Calc(Sender: TObject; var Value: Variant);
    begin
    {Adds up total amount paid for each group}
    Variable2.Value := Variable2.Value + Report.DataPipeline['AmountPaid'];

    {Adds up grand total amount paid}
    Variable3.Value := Variable3.Value + Report.DataPipeline['AmountPaid'];
    end;

    --
    Best Regards,

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