Solved

How can you suppress something in DevExpress based on page numbering?

  • 5 September 2023
  • 2 replies
  • 139 views

Userlevel 4
Badge +11

We are converting a current Crystal Reports report into DevExpress Report Designer. However, in CR I was using a standard formula if PageNumber <> 1 then formula = true to show our company logo only on the main page and a smaller logo on the remaining pages.

Supress company logo on pages unequal to 1

For the PageHeader in DevExpress, the Print on can be applied where "Not with Report Header" can be selected. However, this does not apply to the large company logo because it is in the ReportHeader. Here I would like to use a similar formula to suppress it for page numbering unequal to 1.

On the Internet I came across that a formula PageCount() = [SpecificPageNumber] should exist, however, it does not seem to be available in the downloaded DevExpress variant of TCP.

PageCount() = [SpecifiekPaginaNummer]

What is the best solution for in DevExpress?

icon

Best answer by Dennis van Leeuwen 12 September 2023, 14:21

View original

This topic has been closed for comments

2 replies

Userlevel 6
Badge +3

This worked for me

 

Adding this script to a Before Print event of the selected element you want to surpress. Change the value according to the page number you want.
 

private void pictureBox1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
e.Cancel = this.PrintingSystem.Document.PageCount != 1;
}


I tried doing it within an expression with something like:

[PageNumber] != 1

But this version of DevExpress doesn't seem to have access to that variable. 

Userlevel 4
Badge +11

Thanks @rbiram for the example. In our situation, I was able to use the PageCount for this very well. 

DevExpress - PageCount