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

Store totals in a Temp table and print as seperate report on a group band

edited September 2004 in General
Hi,

I need to print a report with financial data grouped by date, so i created a
group on the datafield 'DATE'. Other then that I need to calculate and store
totals from the records (of the traversed month) in a temp table. Once all
records (of the traversed month) printed, the records from the temp table
need to be sorted in a peculiar way and printed in TppGroupFooterBand
'DATE'. I have a subreport placed on the TppGroupFooterBand 'DATE' linked
to the pipeline of the temp table. Is this kind of reports possible in RB
with regard to keeping the stored totals on sync? I'm asking this question
because the normal way of handling calculations is using TppVariables. I
can't go for this approach in this specific report because i don't know in
advance how many totals (rows) need to be printed.

If so could someone give me advice on what events to use
- to store the totals from the traversed records to the temp table
- to clear the temp table to start a new month

Greetings,
Filip Moons

Comments

  • edited September 2004
    Hi Filip,

    Of course the easiest (fastest/most robust) way to get a report like this
    working properly is to do all the calculations and data processing for the
    temp table before the report is even run. Then you would have two nicely
    formatted tables to work with before entering the report and displaying the
    correct information would just be a matter of traversing and grouping
    existing data.

    If, however you must make calculations that alter a dataset inside
    ReportBuilder, you are going to need to handle all the temp table
    functionality yourself, including making sure the values are in sync with
    the current group. If you are storing values, you probably would not even
    need to use a table. You could possibly just store the given values in a
    TStringList and then using a JITPipeline, insert the values back into the
    report after some calculation. See the main report demo application for
    some examples of using JITPipelines to get data from non TDataSet
    descendants.

    --
    Regards,

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

    Best Regards,

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

    I don't alter any data from the dataset inside ReportBuilder, i'm just
    unaware bout the number of rows (totals) the group band will consist of. I
    can't use a TStringList bc each group total row has a 7 field 'Primary Key'
    (Country,Region,City,Type.....).

    If i would have a dummy tppvariable on group 'DATE'
    - Clear my temp table on tppvariable.OnReSet
    - Update temp table on tppvariable.OnCalc

    Wouldn't this work out fine? I'm only unsure about 'By using TppVariable
    components ReportBuilder will take care of caching
    intermediate results of accumlated calcs that cross pages.'. Could u give me
    some more info bout the caching mechanism.

    Most of our reports have multi row group totals, so i really need to be sure
    that this works out fine

    Greetings,
    Filip Moons.


  • edited October 2004
    Hi Filip,

    The TppVariable component will cache it's current value across page breaks
    so this should work for your needs. One thing to keep in mind is that there
    is a limitation with respect to calculating a total iniside the Page Footer
    band while using a dynamic Detail band. This updates the cached value
    before the report engine realizes the page has broken and therefor the total
    will be one record off. The limitation has been addressed for the next
    release of RB.

    --
    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.