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

Duplicating Subreports

edited February 2009 in Subreports
I have a sales report that shows detailed sales by day for all stores. It
has groups for district and regions. In the group footers I have a subreport
that shows the same detailed sales by day. I also have the same subreport in
the report summary band.So I have the main report and 3 subreports that all
have the same fields. This report has become very propular and I am having
to duplicate it for other customers but they all have customizations and
because there are so many columns in the report it has become extermely
tedious and time consuming to make the sames changes 4 times for the main
report plus the the 3 subreports. I currently copy and paste the subreport
to the different footers and report summary but I then have to go through
and update all of the label names and calc fields because there is some code
behind.

My question is - is there a way to use the same subreport in multiple bands?
I am using RB Standard 10.04. I would be willing to upgrade to version 11 if
it supports a way to do this.

Thanks in advance.

Comments

  • edited February 2009
    Hi Keith,

    For future reference, please use your real name when posting to these
    newsgroups.

    There is no built-in way while designing the report to have a single
    subreport update multiple subreport objects. One option would be to save
    the subreport definition as a .rtm file and load the template into numerous
    empty subreport objects on your main report. Then you can simply edit and
    save the template and when you need to make a change, then all subreports
    will reflect the changes when you run your app.

    Simple template loading code...

    Subreport.Report.Template.FileName := 'MyTemplate.rtm';
    Subreport.Report.Template.LoadFromFile;

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