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

can I use one ppReport with different report files from delphi?

edited December 2003 in General
Hi,

I wonder if I can have only one ppReport in my program and them according to
query load the appropriate report file (rtm).

For instance I would like to have one report and then according to what the
user selects to load labels1X4 or labels1X3 report file.

Currently I have a separate ppReport for each rtm file.

Thanks,
George

Comments

  • edited December 2003
    Hi George,

    Yes... this is definitely possible and is the recommended way of creating
    such an application. Loading a template from file to a report object is
    very simple. The code snip below shows how you should do this.

    ppReport.Template.FileName := 'MyTemplate.rtm';
    ppReport.Template.LoadFromFile;

    ppReport.Print;

    Based on the user selection, you can change the file name and load a
    different template using the same report object.

    Check out the ReportBuilder Demos (\RBuilder\Demos\...) and the
    ReportBuilder Developer's Guide (/RBuilder\Developer's Guide\...) for more
    information on loading templates.

    --
    Best Regards,

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

    I was about to ask the same question as George.


    Does that mean, that I can have one "naked" report on my form without having
    all the report's objects being defined in my Unit and still use the reports
    as if, provided that I have saved all my reports properly and load them at
    runtime?

    Stefan
  • edited December 2003
    Hi Stefan,

    Yes, that is exactly what I would recommend.

    --
    Best Regards,

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