I've been reviewing code from a junior team member who developed an API for generating reports using DevExpress XtraReport. During re-testing before sending it to QA, I noticed that on the last page, there's no data, but the system still prints out the column headers.

So I need to jot down the solution method before recommending it to the junior team member for implementation in my blog below:
📌 Hide Page Header
Create an expression for the PageHeader.Visible property as shown below
[DataSource.IsFirstRow] = true Or [DataSource.IsLastRow] = false
Sample Step in Report Designer

📌 Hide Group Header
Create an expression for the GroupHeaderBand.Visible property as shown below
iif([DataSource.RowCount]=[DataSource.CurrentRowIndex]+1, False, True)
Reference
- https://supportcenter.devexpress.com/ticket/details/t869561/hide-groupheader-on-last-page-if-there-are-no-more-details-records
- DevExpress Expression Guideline
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.



