Thank you Paweld, but 2-pass is not the problem. In a simple report my page numbers and total page count works fine. But if my report has more column than can fit on a page, I run the report multiple times automatically. In these multiples, I need to fix up the page numbering by using a PageOffset variable.
eg, in the footer I wanted to have:
[PageOffset+Page#] / [PageOffset+TotalPages]
but that didn't work as expected.
So with large number of column data, the report can run 2 or more times, but I want to keep the page numbers in sequence. I need to keep track of the number or pages, so I can set the PageOffset variable to the correct value on the next print.
I've solved the problem if I remove the [TotalPages] variable from the report. Then I can simply increment a variable in the Report.OnBeginPage. But as you mentioned, if you use the TotalPages variable, you need to enable 2-pass reporting, which means the OnBeginPage event fires twice as many times as it should. Thus screwing up the PageOffset value.