Page 1 of 1

Change PaperSource during rendering

Posted: Tue Aug 25, 2009 2:18 am
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

Change PaperSource during rendering

Posted: Tue Aug 25, 2009 8:58 pm
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.

Change PaperSource during rendering

Posted: Wed Aug 26, 2009 7:19 am
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

Change PaperSource during rendering

Posted: Fri Aug 28, 2009 12:59 am
by Ivan
Hello,

Let us know if you need any additional help.

Thank you.