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

Load from template into subreport

edited May 2007 in General
Hello,

I am trying to load a custom report at runtime. D7, RB10. I found this
discussed on the board previously, and I followed the example but my report
still does not load. I get a blank page if I try to print just this one
subreport, the coversheet. If I include the subreport(s) that would follow
it in production, the app just starts with the reports and skips the cover
sheet entirely. Not even a blank page. Here is the code.

[code]
//open the datasets that feed into the cover sheet
dsCon.open;
dsArch.open;
dsComp.open;

with sbrCoverSheet.Report do begin
Template.DatabaseSettings.DataPipeline:= plCoversheet;
Template.DatabaseSettings.Name:= 'test sub';
Template.DatabaseSettings.NameField:= 'DESCRIPTION';
Template.DatabaseSettings.TemplateField:= 'FORMAT';
Template.LoadFromDatabase;
end;
[/code]

In my tests, if I add PrintToDevices; and Print; to the with statement, the
only difference is that the blank page comes up in its own preview box.
Using a TppDesigner instead of subreport doesn't make a difference either.

Any suggestions, comments, solutions, obvious things I am missing?

Frank

Comments

  • edited May 2007
    Hi Frank,

    Try creating a simple application that just loads the coversheet into a
    subreport and nothing else and see if that works correctly. If not, you may
    have database issues.

    One other item to note is that child style subreports do not support header
    or footer bands so if your cover sheet template contains information inside
    these bands they will be disregarded in the subreport. The solution is to
    use group header/footer or Section style subreports.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2007
    Nico,

    I have now done the below. I was able to load nothing in the subreport. I
    did verify that the database has data in the requested record and that the
    field names are correct and in the schema. I also verified that I am
    connecting to the database correctly. The report has been set to pbSection.
    A question, is the destination report supposed to be empty or have some
    items and settings in it?

    Frank

  • edited May 2007
    Hi Frank,

    Does this only occur with subreports? Are you able to load this template
    into an empty report object from database? What does the template consist
    of?

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