Home Subreports
New Blog Post: Email: Multi-Service

Combining many reports into one

edited June 2009 in Subreports
Hi,

Delphi 7 + RB 11.02

I have many forms, each containing one or more TppReports (using different
data sources).
I need to print them as one print job, combining into one TppReport. After
reading RB newsgroups, I know that there are actually two ways to do it,
either using SubReports or using TppPublisher (ReceivePage method and so
on).

I have my custom preview form, where I want to show the preview of combined
report, and give the ability to print it. It contains the TppViewer object,
navigation buttons, etc...

I create the internal (combined) report in run-time, then, I'd like to add
any external TppReport into it.

Can I have any advise, how do do it in the most effective way? Is there
maybe any demo or tech-tip that would help me?

Thanks,
Jerry

Comments

  • edited June 2009
    Hi Jerry,

    The easiest way to merge multiple reports is to load them as templates into
    a main report containing section style subreports for each individual
    report. This can be done manually on the fly if needed.

    another option is to use the archive merger to perform the same task, only
    view the merged archives in the archive viewer. The archive merger is
    freeware and can be found on our website.

    http://www.digital-metaphors.com/download/report_component_library.html

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2009
    Thanks, Nico.

    It seems like the subreport option will be fine for me. Can you give me a
    hint, how do I assign a TppReport to a subreport (a line of code)?

    Do I need to set CachePages := True and call PrintToDevices for each
    TppReport to be included (to generate teh report)?

    Thanks,
    Jerry

  • edited June 2009
    Hi Jerry,

    The simplest way would be to save the report template to file or stream then
    load it using the Report.LoadFromFile or Report.LoadFromStream routines.

    1. Create a Section subreport inside the main report (which contains only a
    detail band).
    2. Load the template into the section subreport.
    3. Repeat the steps for as many reports as you would like to combine.

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