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

Get sum from 2 subreports

edited May 2006 in Subreports
I have a main report that contains two subreports, I need to create a
summery which I can subtract the sum of one subreport from the other
subreport, problem is I cannot get one to see the sum value from the other,
how do I get that to work I'm not using RAP?

Thanks
Richard
Win 2K Pro
Delphi 7 Pro
Reportbuilder Pro 7.x

Comments

  • edited May 2006
    Hi Richard,

    I would suggest making all your calculations with TppVariables rather than
    DBCalc components. Start by replacing the DBCalc components in your
    subreports with Variables and calculate their values in the OnCalc events.
    Then place another Variable inside the Summary band of the main report and
    it its OnCalc, subtract the value of one variable from the other.

    procedure TForm1.ppVariable3Calc(Sender: TObject; var Value: Variant);
    begin
    Value := ppVariable1.Value - ppVariable2.Value;
    end;

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2006
    That worked Great thanks !!!!!!!!!!

This discussion has been closed.