UI is one of the most important parts of Report-Designing. Not only does one need to ensure the report's flawless readability with easy comprehension, but that is has a suitable and attractive UI too.

As already discussed in my last blog, the demand for dynamic access to information is increasing day by day. So is the case with designing too. Developers of the present day want to create/modify the report's design at runtime. For this, one needs to access the ReportItems at runtime and change it's properties. The same is discussed in this blog.

Let's take each type of PageReport one by one and discuss it's implementation :


In CPL type of PageReports, the controls are directly added to the ReportItems collection of the Report's Body. Hence, one needs to access the controls present in the ReportItems collection and then change their properties. One can access the control via it's name or index.

Code :

Dim a As String = rpt.Report.Body.ReportItems(1).Name
rpt.Report.Body.ReportItems(a).Left = "2in"



In FPL too, the controls are added in the ReportItems collection. But each page of FPL has an independent collection of ReportItems. Hence, one needs to first access the Pages collection, then it's ReportItems collection and finally the control. As in CPL, the controls may be accessed via name/index in FPL as well.

However, one more catch in this is that the Pages collection referred here is not a part of the PageReport directly but is contained in the FixedPage object of the FPL.

Code :

Dim doc As New Document.PageDocument(rpt)
Dim FP As PageReportModel.FixedPage
FP = CType(doc.PageReport.Report.Body.ReportItems(0), PageReportModel.FixedPage)
Dim txt As PageReportModel.TextBox
For j = 0 To Pagecount - 1
For i = 0 To ItemsCount - 1
txt = CType(FP.Pages(j).ReportItems(i), PageReportModel.TextBox)
FP.Pages(j).ReportItems(i).Left = "2in"
End Try

For complete implementation, please download the following samples :
Download Sample - VB
Download Sample - CS