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

how to calculate this ?

edited February 2004 in General
Hi,

I put two DBCalc(say SalesSum and QtySum, summs) in GroupHeader. Now I want
put a variable AverageSales in the same groupheader which would be just
SalesSum divided by QtySum.
I've tried to use GroupHeaderBand.onBeforePrint and
GroupHeaderBand.onBeforeGenerate events to calculate this variable but it
did not work in proper way.

How can I do that ?

Cheers,
Dmitry

Comments

  • edited February 2004
    And the second question:

    How to force components within groupheader to be calculated in certain order
    ?



  • edited February 2004
    Hi Dmitry,

    You need to use a TppVariable component to make this calculation. You can
    set the value of the TppVariable inside the TppVariable.OnCalc event.
    Something like the following...

    procedure TForm1.ppVariable1Calc(Sender: TObject; var Value: Variant);
    begin
    Value := ppDBCalc1.Value / ppDBCalc2.Value;
    end;

    Note: Be sure the Variable is set to the proper type.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2004
    Hi Dmitry,

    ReportBuilder makes calculations based on teh z-order of the components on
    the report. You can change this order by using the Send to Back and Bring
    to Front features for each component. (Right click popup memu option).

    --
    Best Regards,

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