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

Running total from childreport in main reports footerband

edited November 2008 in Subreports
Hi,

I need to show a running total from a childreport (type hild subreport on
main report detailband) in the mainreports footerband.
-I placed a variable in the main reports footerband
-I placed a variable in the childreports detailband. In the oncalc i add
values to the variable in the main reports footerband

the variable in the main reports footerband = the running total of the page
+ the first detail from the next page
I tried setting the reports to twopass, variables to lookahead = true, it
won't work. Page totals is always total page + first detail next page

How do i get a correct runningt total from a childs report in the main
reports footerband?

Comments

  • edited November 2008
    Hi Filip,

    Unless you would like to display a grand total in the footer band, there
    should be no need to use the lookahead feature. Take a look at the
    following rbWiki article on how to calculate a total in the main report from
    a subreport. One item to be aware of is to be sure that the variable
    located in the subreport needs to be a numeric type (i.e. integer) in order
    to make numeric calculations.

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

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2008
    This only works when the childreports detailband.PrintHeight = Static. Take
    RunningPageTotalFromSubreport.zip from Wiki and set the childreports
    detailband.PrintHeight > Dynamic and the footers variable values will show
    incorrect values.


  • edited November 2008
    Hi Filip,

    This is (still) a limitation in how calculations can be displayed in the
    page footer in ReportBuilder. We have gradually tried to make improvements
    to these limitations including adding support for calculating a page total
    with a dynamic detail in the main report however as you can tell, the
    limitation still exists for subreports.

    I will mark this down as something to research and possibly enhance for a
    later release.

    In the mean time, if you would like to calculate a page total, you will
    either need to use a static detail band in the subreport or make the
    calculation in the main report.

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