C# – Print multiple copies in same sheet. Crystal Reports. .NET

cnetprintingreportwinapi

Using Crystal Reports and .NET I have a requeriment where I need to print 2 copies of the same report on each sheet. I´m able to do this using two subreports setting CanGrow to false, but this doesnt work cause my report may have more than one page, and CanGrow will just crop the rest of the report. Setting CanGrow to false will cause the two reports to overlap, or print one after another. I also tried making a double report, Header – details – footer, and Header – details – footer again (repeating the same information), but crystal reports doesnt allow me to have multiple details sections(with header footer sections between them).

I´m able to reproduce what I want using MsWord, in the printing settings changing the printer setting "print multiple copies" to 2, and then typing and setting Page range to "Page: 1,1,2,2,3,3,4,4… " but the printing API from Crystal Reports won´t let me adjust these settings, not even printing APIs from .NET, so I though of using Native Win32 API, but even if I´m able to do this with Win32 I don´t know how to tell Crystal Reports to use my printing functions.

I´m pretty new to crystal reports so maybe there is a simple solution for this. If someone can help.

Best Answer

I think you'll need to keep your subreport the way you have it, with the report details you want copied, but you can't place the two instances of the subreport in the same section and expect them to space themselves correctly. You'll need to use a second detail section in your main report for your second subreport, then they shouldn't overwrite each other. The detail sections both need cangrow = true set.


OK, all you should need is 2 reports, one formatted the way the customer wants (headers, footers, etc.) to use as the subreport, and one without any headers or footers, but 2 detail sections with cangrow=true and an instance of the subreport in each detail section. I'm not sure why you want a new page after 5 records, but try taking that out and see if you can print the same subreport twice within a main report.

Related Topic