Change PaperSource during rendering

Stimulsoft Reports.NET discussion
Post Reply
Andreas Tastler
Posts: 63
Joined: Fri Jul 17, 2009 5:00 am
Location: St. Gallen, Switzerland

Change PaperSource during rendering

Post by Andreas Tastler »

Hi all

Is ist possible to set the papers source for each rendered page in any event of the report.
We render multiple invoices in one report. The first page of any invoice must be printed on a different paper than the other pages (the page that contains the HeaderBand of the invoices).

Thank you
Andreas
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Change PaperSource during rendering

Post by Edward »

Hi Andreas,

Report template can contain several pages and each of them can use its own paper size. Is it possible to design Header of the Invoice in that separate page (I mean File-> New Page command)?

Thank you.
Andreas Tastler
Posts: 63
Joined: Fri Jul 17, 2009 5:00 am
Location: St. Gallen, Switzerland

Change PaperSource during rendering

Post by Andreas Tastler »

Hi Edward

Unfortunately not, because the first page contains the header and detail data too. But I solved the problem this way:
- in the BeforePrint Event of the Page I set a flag if it is the first page of the invoice
- in the AfterPrint Event of the Page I set the paper source of the current rendered page like this

Code: Select all

string paperSource = "";

if (isFirstPage)
  paperSource = Pages[0].PaperSourceOfFirstPage;
else
  paperSource = Pages[0].PaperSourceOfOtherPages;

RenderedPages[RenderedPages.Count - 1].PaperSourceOfFirstPage = paperSource;
RenderedPages[RenderedPages.Count - 1].PaperSourceOfOtherPages = paperSource;
This solves my problem.

Thank you.
Andreas
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Change PaperSource during rendering

Post by Ivan »

Hello,

Let us know if you need any additional help.

Thank you.
Post Reply