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

Multiple copies pbSection subreports

edited March 2005 in Subreports
Hi,

I have a report that consists of 2 pbSection supreports. When
printed/previewed i get both reports on a seperate page. Now what i want to
achieve is that subreport2 is printed multiple times in the same
preview/print job. What's the easiest way to get this done.

Greetings,
Filip Moons

page 1-X subreport1
page X+1-Y subreport2
page Y+1-Z subreport2
....

Comments

  • edited March 2005
    Hi Filip,

    You can have each one of your section subreport use it's own printer setup
    by simply changing those properties before printing. This should
    automatically set the ParentPrinterSetup property to False and print that
    section subreport independently.

    --
    Regards,

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

    Best Regards,

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

    That's great but somehow it doesn't work overhere. We are using
    reportbuilder 7.02 for delphi 5.
    I created a new report, i removed all bands except the detailband. I Placed
    2 pbSection type subreports on the detailband. Subreport1 has
    ParentPrinterSetup to true. When I change number of copies for Subreport2 to
    3 its ParentPrinterSetup property changes to false, so far so good but
    somehow when I print the report (ShowPrintDialog = False) I only get 1 page
    for each report not the expected 4 (1+3).

    Greetings,
    Filip Moons



  • edited March 2005
    Hi,

    Did some further testing. I changed the orientation for subreport2 to
    landscape. When I view/print the report subreport1 is oriented in portrait
    and subreport2 in landscape. So subreport2 does take its own PrinterSetup
    for viewing/printing but still when printed 1 copy of subreport2 is only
    printed once when it should be 3.

  • edited March 2005
    Hi Nico,

    Could U please reply to my post from yesterday.

    Thank U,
    Filip Moons

  • edited March 2005
    Hi Filip,

    I am currently testing this. Thanks for your patience.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2005
    Hi Filip,

    After tracing through some of the ReportBuilder source, I found that RB was
    not designed to handle multiple copies of separate subreports. You can
    however try to let your printer driver handle this type of print job by
    setting the Subreport.PrinterSetup.DelegateCopies property to True. This is
    a public property and must be set at runtime before the report is printed.

    --
    Regards,

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

    Best Regards,

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

    Sorry to say but DelegateCopies doesn't work either. I just get 1 copie for
    both reports. If I splitt up the mainreport in 2 seperate reports, how can i
    merge them both together as 1 printjob (preview/print), each using its own
    printer setup?

    Greetings,
    Filip Moons

    ppChildReport1.PrinterSetup.Copies := 1;
    ppChildReport2.PrinterSetup.Copies := 3;
    ppChildReport2.PrinterSetup.DelegateCopies := True;

    ppReport1.Print;


  • edited March 2005
    Hi Filip,

    You could try exporting your individual reports to archive files, then using
    the archive merge utility, print them as one print job. The Archive merge
    uitility can be downloaded from our website at the following page...

    http://www.digital-metaphors.com/Subpages/Downloads/CompanionRCL.html

    --
    Regards,

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

    Best Regards,

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

    Erm no offence but a freeware merge utility wasn't what I had in mind. Comon
    this is basic stuff, an accompagning letter and an in voice in twofold and
    RB can't handle this?? Can't i use printdevices/screendevices to get this
    done.

    Greetings,
    Filip Moons

  • edited March 2005
    Filip,

    I apoligize, but this is the best advise I can give you. There is no other
    way to merge two reports into one single print job unless you use two
    section style subreports in a single main report. However, as I mentioned
    in one of my previous posts, ReportBuilder was simply not designed to handle
    multiple copies of a given subreport.

    The only other thing I can think to try is to dynamically create another
    subreport based on how many copies of a certain subreport you need, then
    copy the template into that subreport essentially printing three subreports,
    one copy of the first subreport and two copies of the second.

    --
    Regards,

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

    Best Regards,

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

    I solved the problem using a TppJITPipeline attached to the mainreport as a
    loop counter and putting both section type subreports in the detail band.
    When previewed setting its RangeEndCount to 1, when printed setting its
    RangeEndCount to the number of copies of the 2nd subreport I want and
    setting subreport1 visible property to false when ppJITPipeline.RecordIndex
    from 1 on. Not the most elegant sollution but it works.

    Greetings,
    Filip Moons

This discussion has been closed.