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

DBCalc in Footer reset value problem

edited September 2003 in General
I use DBCalc in Footer band with sum option.
In old versions of RB (3.5) DBCalc value was reset on next page.
Now (I use 6.02) DBClac values accumulate with self values from Prev Pages.
How to calculate sum(Field) on page?

Thanks,
Nikolai Bochkarev

Comments

  • edited September 2003
    Hi Nikolai,

    Now you can change the timing of a DBCalc in ReportBuilder. Simply right
    click the DBCalc component and select Timing from the pop-up menu. From the
    timing dialog you can select when you would like the DBCalc to reset itself.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2003
    > Now you can change the timing of a DBCalc in ReportBuilder. Simply right
    the
    itself.

    Sorry, but my DBCalc component does not have "Timing" in popup menu!
    "Timing" menu have "Variable" component!

    Thanks,
    Nikolai Bochkarev
  • edited September 2003
    Hi Nikolai,

    I'm sorry, I was mistaken. DBCalcs can only be reset on group breaks now
    using the ResetGroup property. If you would like to reset on each page you
    will have to do the calculations manually in a TppVariable's OnCalc event
    and adjust the Timing of that variable.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2003
    > I'm sorry, I was mistaken. DBCalcs can only be reset on group breaks now
    you

    Thanks for help of my problem!
    Would you help me to write RAP Code to calculate Sum(Field) by page?
    I try ti write this code but get failed :(

    Thanks,
    Nikolai Bochkarev
  • edited September 2003
    I'm build work this code
    (my mistake was PassSetting = psTwoPass)
    in Footer i'm place Variable1 component and in global vars declare
    var
    Sum : currency;

    rap code:
    procedure ReportOnStartPage;
    begin
    Sum := 0;
    end;
    -------------------------
    procedure DetailBeforePrint;
    begin
    Sum := Sum+ Query1DataPipeLine['F1'];
    end;
    -------------------------
    procedure Variable1OnCalc(var Value: Variant);
    begin
    Value := Sum;
    end;

    Thanks!
    May be this fact add in FAQ? :-)
    Nikolai
This discussion has been closed.