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

problem calculating subreport field

edited December 2004 in General
i hav a master - detail structured report, where i hav my detail table shown
in subreport,
what i wan here is to SUM a detail's field and display the result outside of
the subreport.
i've try puttin a DBCal in my Footer, but what i actually get is only the
SUM of each detail's first record...
i wonder if there's anything i hav miss out ...

beside, i would like to know if there's anyway i can design a master -
detail structured report without using subreport, which i can easily
accomplish this is RB version 4.23pro

any suggestions or solutions r welcome ..
btw, the RB i'm currenctly using is v7.04

Comments

  • edited December 2004
    Hi,

    In order to calculate a sum and display it outside a subreport you will need
    to use two TppVariable components. Place one TppVariable inside the Detail
    band of the subreport with its Visibility set to False. Then inside its
    OnCalc event update the Value property of the second variable located in the
    main report where you would like your sum displayed. The example below
    shows how this can be done.

    http://www.digital-metaphors.com/tips/TotalsFromSubReport.zip

    The subreport archetecture was added after RB 4 as the only way to make a
    master/detail report. We found this was a much easier and more elegant way
    of structuring reports of this kind.

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