Question

Now, I am working with ActiveReport in ASP.net and C#. I would like to know that can I get page number in "Section Event". I want to show some data when the page number is not equal to 1. So , I want to get page number in Detail_Format Event. Can I?

 private void detail_Format(object sender, EventArgs e)
{  
   int pageNumber = 0;
   //getting page number
   if(pageNumber == 1)
   {
     //do some function
   }
   else
   {
     //show some data
   }
}  

So, I need to know current page number. Please help me.

With Regards.

Was it helpful?

Solution

if(this.PageNumber == 1)
{
}

PageNumber is a property of the current running report. However, when using it in Detail_Format event you should know that it might not be accurate in cases where a section is formatted on one page then needs to be moved to another page because of fitting. The more accurate place to use PageNumber in the BeforePrint event.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top