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

Section Subreports

edited January 2010 in General
Hi
I need some help. I've got a main report with a detail that prints to a
default printer. Inside that band I have a section subreport with a new
print job that prints to a label printer. The problem is that the main
report should print 2 copies but the section only one. If I send only
one copy to the main report it works ok, but with 2 copies the main
report remains in queue and the print doesn't start until I leave the
application. Any idea?. Is there another way to do that with just one
report?.
Thanks

Comments

  • edited January 2010
    A couple of things you can try.

    1. Try setting Report.CachePages to True. Then retest.

    2. Try setting Report.Printersetup.DelegateCopies to True. This is a public
    property, so you have to set it in code. Or set PrinterSetup.Collation to
    False. Setting either of these will cause each page to be generated only a
    single time, the printer will be responsible for generating the copies. Most
    printers (but no all) support this capability.

    OR

    3. Another option is to try altering the report structure. Create a main
    report with no header or footer. Place two section style subreports in the
    detail band. Set each to PrintBehavior of pdSection. Use Section1 for the
    two copies report and use use Section2 for the Label report. (I do not know
    whether this will provide a better result, but you can give it a try).



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    Thanks.
    I'll try and I will notify you if I'm successfull


    Nard Moseley (Digital Metaphors) escribió:
  • edited January 2010
    Hi.
    I've tried the three posible solutions but nothing happens. In fact I
    supposed that the 3rd one would be the correct so I've built an example
    but the in that way, the report stops in the first record of the first
    section.
    Could I upload somewhere a simple example .rtm with a txt file as a
    datasource to see the problem?.
    Thanks

    Nard Moseley (Digital Metaphors) escribió:
  • edited January 2010
    Example can be emailed to support@ in zip format. Include a complete
    runnable example rather than an .rtm. Use only standard Delphi components
    and RB. You can dump some of your data out to a TClientDataSet or as you
    say, use a text file. Or use the DBDemos data.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2010
    Hi Nard.
    I made it work!!. while I was preparing the example to send, I found
    the needed setting combination. Basically the problem was the amount of
    copies of the main report. With only one copy the report works ok but
    with two copies the whole report remains in queue until I leave the
    application. What I did is to set the section as follow:
    Both sections with new print job.
    In the OnPrint event:
    Report.Autostop := false;
    Report.PageLimit := Cantofcopies; (where CantOfCopies is the main
    Report.PrinterSetup.Copies value;
    Report.DetailBand.PrintCount := 1;

    I don´t know if that is the correct way to do it but It solves the
    printing problem
    Thanks for answering


    Nard Moseley (Digital Metaphors) escribió:
This discussion has been closed.