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

Need Help with TppVariables

edited January 2005 in General
hello,

I am having trouble with the timing of the calculations for a report
that I am working on. This report is a transaction listing for a
particular customer and I've got the report grouped by the customer key.
In my group header I have a variable for the starting balance (the
report can list all or part of the transactions. I am querying the
transactions prior to the date requested to get the balance to date). In
my detail band, I have several database fields, a TppDBCalc and a
TppVariable. The DBCalc is a non visible and I am using it only to get
the sum of the amount field. In the OnCalc event of the Variable field
on the detail band, I am calculating it as follows:
Value := (value of variable in group header) + value of the DBCalc.
This calculation works, except that the value is printed on the
following line. I need it to print on the same line as the transaction
amount. I have played with the calcorder and calctype and resettype and
I can't seem to find the proper settings for this to work. Can someone
help me? I would really appreciate it!

Thanks!

David Alge

Comments

  • edited January 2005
    Hi David,

    Instead of using a DBCalc to calculate the running total for each group, try
    using two TppVariables. Inside the OnCalc event of the non-visible
    TppVariable do something like the following...

    Note: ppVariable1 is the value in the group header.
    ppVariable2 is the visible variable in the detail band.
    ppVariable3 is the invisible variable whos OnCalc event we are in.

    procedure TForm1.ppVariable3Calc(Sender: TObject; var Value: Variant);
    begin
    Value := Value + ppReport1.DataPipeline['AmountPaid'];

    ppVariable2.Value := ppVariable1.Value + Value;
    end;


    --
    Regards,

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

    Best Regards,

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