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

Printing 3 + 1 copies

edited August 2007 in Subreports
Customer wants a delivery note to print 3 copies followed by 1 copy of Terms
and Conditions.
I created a report with two Section subreports. The first subreport
contains the delivery note and has ParentPrinterSetup:=False, the report it
contains (the delivery note) has PrinterSetup.Copies:=3. The second
subreport contains the T&Cs.

On printing I only get 1 copy of the delivery note. What am I doing wrong?

Regards
Paul

Comments

  • edited August 2007
    Hi Paul,

    The copies property cannot be set for individual section subreports. In
    order to get the effect you are after, you could either dynamically create
    two more section subreports to act as copies of the first one, or keep the
    Terms and Conditions page in a separate template and load and print it as a
    new job after the three copies of the first report have finished.

    --
    Regards,

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

    Best Regards,

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

    I have seen the examples of how to create a subreport in code but it isnt
    practical to create all the contents object by object. Is it possible to
    have all the subreports.reports point to the one existing subreport.report -
    or to copy it?

    Regards
    Paul

  • edited August 2007
    Hello again Nico

    I decided to just duplicate the subreports by copy and paste (horrible for
    maintenance). It caused some difficulty in that variables in the footers
    are set to the values of invisible DBCalcs in the detail subreports and the
    names of these objects are specifically required in the code.

    The result only worked for a single document. If the data extraction was to
    print several documents the data navigation goes crazy (I think each
    subreport carries on through the data instead of resetting to the documents
    start position each time - I didnt actually look too closely, just saw it
    was wrong).

    I assume the above problem would persist if I had been able to follow your
    suggestion of creating additional subreports in code.

    I havent quite worked out how to do it as seperate print jobs. For each in
    a list of document numbers set an sql parameter. Set ShowPrinterDialog to
    true and print one. Set ShowPrintDialog to false and print another (I'm not
    sure if printer settings will persist or I will have to read them from the
    first print and write them to the second). Print again. Finally print
    another report with just the T&Cs. Is this what you had in mind?

    Finally - you can set the PrinterSetup.Copies for subreport.report - it just
    doesnt do anything ;-)

    Regards
    Paul
  • edited August 2007
    Hello again again Nico

    It turns out that was given incorrect requirements. What the customer
    actually wants is to print to 4 part laser paper - parts 1,2 and 3 are
    copies of each page of data and part 4 is the T&Cs. So if there where 2
    documents d1(2 pages) and d2 (1 page) they want
    d1 - p1
    d1 - p1
    d1 - p1
    T&Cs
    d1 p2
    d1 p2
    d1 p2
    T&Cs
    d2 p1
    d2 p1
    d2 p1
    T&Cs

    Without the T&Cs this is easily achieved by setting turning Collation off
    and setting copies to 3.

    In order to print the T&Cs I tried putting them into a section subreport in
    the footer - but it doesnt print. (It does print in the group footer - but
    thats no good). So the only problem to solve now is printing the T&Cs.

    Regards
    Paul


  • edited August 2007
    Hi Paul,

    After further research, it is possible to assign individual copies to a
    Section style subreport by allowing your printer to handle the copies (if it
    is capable).

    1. Create a section subreport with ParentPrinterSetup set to False and
    NewPrintJob set to True.
    2. Inside the child report set the PrinterSetup.Copies to 3 and Collation
    to False.
    3. Use the DelegateCopies property to give control of copies to the
    printer. Assign this property before calling Report.Print...

    ppChildReport1.PrinterSetup.DelegateCopies := True;

    4. Add another section subreport containing the Terms and Conditions.
    5. Print the report.

    --
    Regards,

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

    Best Regards,

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

    That was a very interesting answer - I shall salt it away. Unfortunately
    the requirement has changed slightly so I shall post a new question called
    '4 part printing'.

    Regards
    Paul

This discussion has been closed.