Skip to main content

Accessing Report Elements

Version: 8.0

Accessing Report Elements

To achieve access to any elements defined within the DPLX file the GetReportElementById method of the DocumentLayout class should be used. After passing in the elements appropriate unique ID, the element returned from the GetReportElementById needs to be cast to its respective type before use. For more information on associating a DPLX file see Associating the DPLX File or see Using a DPLX file from a Web Form for more on associating a DPLX file with a Web Form.

The following snippet of code demonstrates how to reference a PageNumberingLabel that was defined in the DPLX file and at runtime change color of the text that will display.

using ceTe.DynamicPDF.ReportWriter.ReportElements;
...
PageNumberingLabel PageNumberingLabel1 = (PageNumberingLabel)reportDocument.GetReportElementById( "PageNumberingLabel1" );

PageNumberingLabel1.TextColor = ceTe.DynamicPDF.RgbColor.Red;
Imports ceTe.DynamicPDF.ReportWriter.ReportElements
...
Dim MyPageNumberingLabel As PageNumberingLabel = CType(Report.GetReportElementById("PageNumberingLabel"), PageNumberingLabel)

MyPageNumberingLabel.TextColor = ceTe.DynamicPDF.RgbColor.Red