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

Totals and SubReports

edited March 2003 in General
I have a report which uses a subreport. How do I get the total from the
report and the total from the subreport to generate a grand total.? Any help
would be appreciated. I am using RBPro 6.03, Advantage 6.2 and Delphi 5.

Brian

Comments

  • edited March 2003
    Brian,

    Below is a link to an example that should help you. This example shows how
    to get the total from a Subreport and print it in the report's summary band.
    All you would have to do is add the report's total to the subreport's total
    using the subreport's variable in its OnCalc event to display the grand
    total.

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


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2003
    This is great. But I need to be able to do this for end user reports. My
    end users are not using delphi.

    Thanks,

    Matt
  • edited March 2003
    Here is an example that shows how to do this using RAP:
    http://www.digital-metaphors.com/tips/MDRapRunningTotal.zip. It is possible
    to do this using Report Application Pascal (RAP). RAP allows you to keep
    all report code in the report template separate from the Dephi .exe so
    calculations can be done without the use of Delphi. RAP is available with
    the Enterprise Edtition of ReportBuilder 7.02. If you would like to test
    the report capabilities of RAP, please download a trial verion of
    ReportBuilder 7.02 Enterprise from our website at
    http://www.digital-metaphors.com. Be sure to back up any reports you are
    working on before you install the new version.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2003
    I am still having problems getting a Grand total on a report from the detail
    entries and the totals from subreports. The example uses I belive RB 7 and I
    am using 6.03. I looked at the code and the report and it is not exactly
    what I have.

    I have a report with a subreport(style child) at the end of the report. I
    want to display the totals of the main report with the totals of the
    subreport to come up with a grand total. I have tried to use the oncalc
    event of a variable but do not get the desired results.

    Attached you will find some sample code to demonstrate what I want to do,
    although it does not work. Any help in this matter would be greatly
    appreciated.

    Thanks,

    Brian
  • edited March 2003
    I forgot, I moved the subreport to the detail of the main report.

    Brian

  • edited March 2003
    Brian

    Please send all examples to support@digital-metaphors.com instead of
    attaching them to a news message. I took a look at your code and was able
    to calculate the grand total of the AmountPaid field at the end of the
    report. I attached an altered version of the example you sent me and sent
    it to your e-mail address. I hope this helps.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.