If you know the structure of the report, the total number of pages can sometimes be calculated based on number of records returned by SQL. If there are groups in the report, often it is possible to know how many of them there will be. The report can be desigen in a way to make the number of pages more certain. For example, you can specify the number of records to be printed on each page.
If it is just some existing report of which structure nothing is known, I don't think there is a way to know in advance how many pages it going to print.