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

detail sum by type

edited November 2005 in General
Hi,

i have a report like this:

id type number
-----------------------
1 A 100,00
2 A 200,00
3 B 250,00
4 C 150,00

in summary band i need to print a sum by Type:

sum A 300
sum B 250
sum C 150

how can i do it?



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited November 2005
    Hi Ennio,

    I would suggest placing an invisible TppVariable inside the detail band and
    in its OnCalc event, update three other TppVariables located in the summary
    band based on their type. For instance...

    procedure TForm1.ppVariable1Calc(Sender: TObject; Value: Variant);
    var
    lsType: String;
    lsNumber: Integer;
    begin

    lsType := ppReport1.DataPipeline['Type'];
    lsNumber := ppReport1.DataPipeline['Number'];

    if lsType = 'A' then
    ppVariable2 := ppVariable2 + lsNumber
    else if lsType = 'B' then

    ... and so on.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2005
    Hi Nico,

    it's ok when the number of 'type' is defined.


    i'don't know how many 'type'.
    it's possible 'n' type.

    tks

    and
    summary



    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.