Skip to main content
Solved

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

  • September 5, 2023
  • 2 replies
  • 272 views

Dennis van Leeuwen
Hero
Forum|alt.badge.img+12

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?

Best answer by Dennis van Leeuwen

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

DevExpress - PageCount

 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

rbiram
Hero
Forum|alt.badge.img+4
  • Hero
  • September 5, 2023

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. 


Dennis van Leeuwen
Hero
Forum|alt.badge.img+12

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

DevExpress - PageCount

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings