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

Sum amount in Subreport

edited February 2004 in General
Hi,
May I know how to sum an amount in a subreport and display it
at the end of report??

Comments

  • edited March 2004
    HI Vincent,

    You can calculate the sum of the amount inside a subreport at the end of the
    main report by using TppVariable components. Simply place an invisible
    TppVariable inside the detail band of the subreport, and another TppVariable
    in the Summary band of the main report. Then in the OnCalc event of the
    first TppVariable, update the value of the second TppVariable with the
    current sum. Something like the following...

    procedure TForm1.variable1Calc(Sender: TObject; value: Variant);
    begin
    Variable2.Value := Variable2.Value + Report.DataPipeline['Amount'];
    end;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    It's worked. Thanks!!


This discussion has been closed.