Home Subreports

dynamicaly assign a subreport

edited January 2003 in Subreports
Hi there,

I have a serveral reports that i wish to use as a subreport. These
'subreports' will contain the dealer information for eg. invoices.
Now, the users may use a default logo (subreport) or they may design(or
adjust) there own logo.
How do i assign dynamicaly the contents(layout) of a subreport to a report.
In the headerband of the report(main) i'll provide a region to place the
subreport in....

Any idea? I can't find a sollution. (I'm new to reportbuilder)

Anyway, thanx in advance!!

Vincent

Comments

  • edited January 2003
    In the designer, you or a user can load and save subreports using the File
    menu, from inside the subreport workspace. The subreport has a Report
    property, which means it has the standard Template property. You can do
    this programatically:

    Subreport.Report.Template.Filename := aPath + 'myfile.rtm';
    Subreport.Report.Template.LoadFromFile;

    There is also an example of creating a subreport descedent which does this
    automatically, to support common title, header and footer bands from one
    template across all reports. See the installed
    RBuilder\Demos\EndUser\DynamicSubreportLoading example.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited January 2003
    thx,

  • edited January 2003
    My problem is more of the kind that i have both-the master and the one with
    the dealer data- reports loaded from database(this works)

    Now, on my "master" reports i will have a region with a subreport in it
    (this for every type of invoice in the package)
    When i design the report dynamically i name the username to "DealerLogo",
    swat, i can find the subreport but then, what do i have to do to link the
    contents to the "sub"-report to the DealerLogo subreport in the
    mastereport..

    Thx,
    Vincent
  • edited January 2003
    Something I do that helps quite a bit: create the report at design time that
    works. Save it to a file.

    Next create a report at run time that suppose to work but you can't figure
    out what you are doing wrong. Save it to another file and use a tool such as
    BeyondCompare to compare the two files to see what your missing.
    Alternatively, you could open it up in the designer and see what you
    misconfigured.

    --
    Ed Dressel
    Team DM
This discussion has been closed.