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

Subreports subtotlas at end of page

edited March 2011 in Subreports
Hi,

for my job I need to have a report, containing subreports that will print
subtotals of the columns at the end of the page, if the report is not yet
finnished :

SWe have amain report, containing 2 subreports.
In the second subreport, we start a new page, print some header data, and
then a grid with all kinds of data (not database related data).

Now, if this second subreport should go to a seond page, we need a subtotal
of 2 columns on the end of page 1.

I now use 2 variables in which I keep the summation at the onprint of a
label on the row row, but problem is that when it prints the subtotal, th
efirst item of next page is already counted in the subtotal, end at the end
of the report on page 2, this item is then counted for 2 times, as on the
new page, it is also ones more added to my subtotal in the onprint event of
the label..
So, can I somehow, before I add to my subtotal, have a check to see if the
running item can still print on the current page?

Comments

  • edited March 2011
    Hi Luc,

    Which version of ReportBuilder are you using? Are you using TppVariables
    and the OnCalc event to make your calculations? The calculation of
    subtotals was an issue for some earlier versions of ReportBuilder with
    dynamic height detail bands but this has been addressed in most cases.



    Regards,

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

    Best Regards,

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

    thx for your prompt reply.
    We don't use a tppvariables, but a global delphi variable for
    calculating this subtotal/total.
    On the onprint of the first label in the detailband of my subreport, I
    do the summation.

    If u provide me an address whereto I can send u a samplecode, I would be
    thankfull.

    Kind regards
    Luc




    Op 1/03/2011 15:10, Nico Cizik (Digital Metaphors) schreef:
  • edited March 2011
    Nico,

    sory,

    I forgot to mention our RB version : 12.01 build 197

    Regards,

    Luc

    Op 1/03/2011 15:10, Nico Cizik (Digital Metaphors) schreef:
  • edited March 2011
    Hi Luc,

    The fact that you are making calculations outside the OnCalc event of a
    TppVariable will most likely lead to incorrect calculations when generating
    a report. The OnCalc event is designed to handle this type of report.
    Otherwise you would need to manually keep track of the page break and
    prevent the value from being updated in that case.

    http://www.digital-metaphors.com/rbWiki/Delphi_Code/Calculations/Overview

    You can send a simple example to support@digital-metaphors.com in .zip
    format if you would like.



    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.