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

detail oncalc fires twice

edited January 2013 in RAP
Hi,

in a prior version (delphi7, reportbuilder 9.02) we made lots of reports
with an oracle query (Doa).

In the detail.oncalc event we calculated the variables ourselves,
placing it in the right columns and added it to (sub)totals.

vrblDetail_01.Value := vrblDetail_01.Value + MKIntakes['Amount'];
vrblSubtotaal_1_01.Value := vrblSubtotaal_1_01.Value + MKIntakes['Amount'];


We migrated to delphi (XE2 reportbuilder 14.06) and see that the first
displayed value (record) is not correct anymore. I debugged it using
showmessage from the utility functions. We found that the detail.oncalc
event fires twice in version (14.06). It only fires once in version 9.02.

Is this a known issue and is there a work around for this?


kind regards

Ruud

Comments

  • edited January 2013
    Make sure Variable.DataType is set to a numeric type - something other than
    dtString. When set to dtString the OnCalc fires more often because string
    values are not cached by the Variable.

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2013
    Thanks Thats it .... but,

    I have to check around 100 reports and deliver these to our customers.
    Is there a way to do this in our program? So it behaves like it did in
    the older version of reportbuilder?

    Kind Regards

    Ruud


  • edited January 2013

    You could try writing some code to load the report, iterate over the
    Report.Bands[ ].Objects[ ] and then find Variables with dtString and modify
    them.

    The change was made to fix bugs reported by customers using Variable with
    dtString to process strings.

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2013
    Thanks for the tip.

    Kind regards

    Ruud

    Op 3-1-2013 18:05, Nard Moseley (Digital Metaphors) schreef:
This discussion has been closed.