ReportViewer WebForms TotalPages shows zero when there are multiple pages

Jason Wilburn 5 Reputation points
2023-03-22T20:05:22.5066667+00:00

I have an application that uses Microsoft.ReportingServices.ReportViewerControl.WebForms Version: 150.1537.0 (.NET 4.8 framework) to display SSRS reports. The issue that I'm currently experiencing is that sometimes the TotalPages number in the toolbar shows 0 when there is in fact more than 1 page. If I click the Next Page button, the report re-renders and the toolbar shows the correct page numbers. See screen shot below. Any ideas on how to fix this or is it an issue with the existing ReportViewerControl version?

User's image

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,786 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. AniyaTang-MSFT 12,306 Reputation points Microsoft Vendor
    2023-03-23T03:04:36.61+00:00

    Hi @Jason Wilburn

    Is there data returned when the number of pages is 0?

    If there is data and the number of pages is incorrect, there may be a problem with the toolbar configuration. If you want to configure the ReportViewer toolbar, you can do so by setting properties in the Properties window or in code. For the Microsoft.Reporting.WebForms.ReportViewer property, you can refer to this link: https://learn.microsoft.com/en-us/dotnet/api/microsoft.reporting.webforms.reportviewer?redirectedfrom=MSDN&view=sqlserver-2016#properties.

    Among them, you can try to configure properties such as CurrentPage, PageCountMode, etc.

    CurrentPage can get or set the current page of the active report of the ReportViewer control.

    PageCountMode can get or set a PageCountMode enumeration value that indicates the default page count mode to use when rendering the report in the report area.

    If the answer is helpful, please click Accept Answer and Up-Vote for the same. If you have any questions, please feel free to let me know.

    Best regards,

    Aniya