Protected void Page_Init (object sender, EventArgs e)
So, here’s the code for getting your hands on correct values of these properties: However, be aware that these properties are not set correctly, until the Crystal Report Viewer control is finished rendering the Report (or in other terms, is finished generating the markup for the report), after which you should be able to get correct values for these properties. In particular, it provides the LastPageNumber and PageNumber properties, which respectively give you the total number of pages, and the current page number of your Crystal Report. But if you analyze this control, you will notice that it provides a ViewInfo object (of type ), that should provide sufficient information for you to be able to think of creating a custom toolbar for the report. And for this, you further need to know the total number of pages that the report would have based on the data loaded into it, and the print settings you have specified.Īs it turns out, you do not have a direct NumberOfPages, or a similar property on the Crystal Report Viewer control. Now, thinking of replacing the default Crystal Report toolbar, the first thing you would need to provide users is a way of navigation between the Report pages without the toolbar. Both of these blog entires concentrate on having more control over the actual Report Generation to be able to replace the default Crystal Report toolbar, with a custom one, that integrates better with the overall design of your web application. This is the first of a couple of blog entires I am writing for web-based ASP.NET Crystal Reports.