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

DB Calc

edited October 2015 in General
RB v17, XE7 Firedac Table ( tried with SQL also, same result )

Dbcalc is not iterating through dataset.
Seems to be returning the first record value.

Dbcalc component set to Sum and is placed in a Summary section.
Weird because this was never a problem in prior versions.

If dbcalc is placed in a footer, on the last page it is showing first
record value.

Seems to be summing for each page o.k. but not the final result

Comments

  • edited October 2015
    Hi Mike,

    I tried a simple test here and did not encounter any issues. I used RB 17,
    XE7 and FireDAC. I used the new RBDemos database installed with RB 17.

    Make sure the report/childreport DataPipeline property is assigned so that
    the report iterates over the data. (RB elements such as DBCalc rely on the
    report to iterate over the data).

    If you would like to create a simple example project that I can build and
    run here, I can test it in the debugger. Please use standard Delphi
    components and RB. Use the RBDemos data or copy data to TClientDataSets.
    Send in zip format - include only .dpr, .pas, .dfm. Send to support@




    Best regards,

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2015
    Nard,
    Sample of problem in zip sent to support@ ( maybe defaulted to Nico though).
    I think its a Firedac/Firbird issue

    Mike

  • edited October 2015
    I think it should be due to a property CalcsOutOfSync in class TppEngine
    was set to False in TppEngine.Init method. CalcsOutOfSync was set to
    true previous version of ReportBuilder.

    You may try set TppEngine.CalcsOutOfSync to true in TppEngine.Init as a
    workaround solution.

    --
    Best regards,
    Chau Chee Yang
  • edited October 2015
    Thanks

  • edited October 2015
    HI Mike,

    I followed up via email. For others reading, the solution has two parts.

    1. Patch for RB 17 to fix DBCalc/Variable not computing for first record

    2. Modify report to use TppVariable with DataType set to dtCurrency and
    implement the OnCalc to perform the calculation.



    Best regards,

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2015
    Thanks Nard,

    The Patch installed very quickly and problems resolved.

    Mike
    _________________________________________________
This discussion has been closed.