Hi,
My report has multiple pages. How can I display different title per page programmatically without adding the Label element of each page page in the designer?
If I add the Placeholder element in the Header or Template is there a way to get a Current Page number within the callback event to assing title programmatically?
Thanks
Report title per page
Re: Report title per page
Support · Apr 19, 2011Hello,
Using the below code you can generate a PDF document from the dplx file and use the DocumentLaidOut event and add a label for each page.
DocumentLayout report = new DocumentLayout(@"SimpleReport3.dplx");
report.DocumentLaidOut += new DocumentLayoutEventHandler(report_DocumentLaidOut);
Document document = report.Run();
document.Draw(@"SimpleRpt1.pdf");
DocumentLaidOut Event Handler code:
static void report_DocumentLaidOut(object sender, DocumentLayoutEventArgs e)
{
for (int i = 0; i < e.LayoutWriter.Document.Pages.Count; i++)
{
e.LayoutWriter.Document.Pages[i].Elements.Add(new ceTe.DynamicPDF.PageElements.Label("Page" + i, 100, 0, 100, 20));
}
}
Thanks,
ceTe Software Support Team.