Page 1 of 1

Printing multiple copies of a report

PostPosted: Fri Aug 24, 2018 4:57 pm
by Atronics
How can crystal be setup so that when printing an invoice for example, it will print a second copy of the invoice for filing. I have tried placing a copy of the main report as a sub-report in the footer, but this presents problems in passing the parameter to the sub report. I am using the InvoiceHistoryID as the link, but this does not pass to the sub-report..

Re: Printing multiple copies of a report

PostPosted: Sat Sep 01, 2018 12:09 pm
by Mike.Sheen
For passing parameters to a sub-report, take a look at How can we pass a parameter from main report to subreport in crystal reports XI.

If you're adding a subreport simply to cause 2 copies to be printed, why not set the # Copies in the Printer Setup in Jiwa?
PrinterSetup.PNG

Re: Printing multiple copies of a report

PostPosted: Sat Sep 01, 2018 7:37 pm
by Atronics
Yes. Mike. That will work, but I need to be able to allow/suppress some text on the second copy. I can't see how the Crystal report can be aware of what copy (first or other) is being printed.
I have tried replicating the original report as an edited (additional text included) sub-report, and passing the original stored proc parameter to the sub report. This is causing the sub-report to print over as many pages as there are groupings in the report. i.e it prints the header and subsequent sections on separate pages.


Regards
John I.

Re: Printing multiple copies of a report

PostPosted: Sun Sep 02, 2018 12:39 pm
by Mike.Sheen
Atronics wrote:I need to be able to allow/suppress some text on the second copy. I can't see how the Crystal report can be aware of what copy (first or other) is being printed.


Ahh, I think I understand now what you're after.

Without actually trying some things out and doing it myself, I can't tell you what will work, but I'd try adding a formula which defaults to a value - say, 0, and that gets passed as a parameter to the subreport - but the main report will set this fomula value to 1 before the section the subreport sits in.

Or, you could possibly use a shared variable the same way.

The result should be that you can suppress / not suppress areas of the report based on the value of the formula or shared variable, and you will have that value as 1 only in the subreport.