This SSRS article shows how to add page numbers to a report using the global variables. To do this, we must use the Page Numbers to combine PageNumber and TotalPages variables.
How to add Page Numbers to SSRS Report?
Right-Click on the Datasets folder to create a new DataSet. The screenshot below shows the data set we will use for this example.

The Sql query that we used above SSRS example is:
SELECT SubCat.[EnglishProductSubcategoryName] AS SubCategory, Prod.EnglishProductName AS ProductName, Prod.Color, SUM(Fact.OrderQuantity) AS Orders, SUM(Fact.TotalProductCost) AS ProductCost, SUM(Fact.SalesAmount) AS Sales, SUM(Fact.TaxAmt) AS Tax FROM FactInternetSales AS Fact INNER JOIN DimProduct AS Prod ON Fact.ProductKey = Prod.ProductKey INNER JOIN DimProductSubcategory AS SubCat ON Prod.ProductSubcategoryKey = SubCat.ProductSubcategoryKey GROUP BY SubCat.[EnglishProductSubcategoryName],Prod.EnglishProductName, Prod.Color
We designed a simple table report and formatted the font and colors to demonstrate the process of adding page numbers.

The below image shows the report preview.

Since the numbers have to repeat on each page, we have to place them in the page footer or header. So, right-click on the empty space, choose the insert option, and select Page Footer.

Right-click within the page footer, choose insert, and then select the text box option to add a text box field.

Right-click on the text box and select the expression option from the context menu.

Write the following expression to add or display page numbers in the SSRS table report.
="Page Number = " + CStr(Globals!PageNumber)

Now you can see the page numbers on each page of the report.

However, we need to find out how many pages are left. To get this, we have to alter the above expression so that it will display the total pages along with the page number.
="Page Number = " + CStr(Globals!PageNumber) + " Of " + Globals!TotalPages

Looking at the preview now, you can see the page number and the total number of pages the report has generated.

Let me show you the last page.
