Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
pajarokillo
Starting Member
12 Posts |
Posted - 2005-08-23 : 07:20:58
|
Hi!, Someone know how to get the number of pages that a report is divided?. I use the ReportViewer to get the report and i need to know how many pages have the report. Thanks |
|
eralper
Yak Posting Veteran
66 Posts |
Posted - 2005-08-23 : 09:17:00
|
Hi,I use the below expression in a Textbox where I place in the page footer to show current page number and total page count= Globals!PageNumber & " / " & Globals!TotalPages-------------Eralperhttp://www.kodyaz.com |
 |
|
pajarokillo
Starting Member
12 Posts |
Posted - 2005-08-23 : 12:16:53
|
Yes eralper, it's ok, but i am using the ReportViewer object for to view a report, can i get the Globals collection from ReportViewer object?. You understand me?. Thanks for read my post. |
 |
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2005-08-23 : 12:31:15
|
The Globals collection is populated during run-time, but I do not believe it is available outside of the report. However, if all you need to do is display the number of pages, then put that into the report definition. Neither do I believe that the ReportViewer object exposes the total number of pages. In fact, the number of pages varies depending on the type of output. When I view a report in the native ReportServer format, the pages are much longer (fewer number of pages) than when I go to Print Preview mode or export to PDF.If you'd like to share with us what you're trying to accomplish, we might be able to help you come up with a good solution.---------------------------EmeraldCityDomains.com |
 |
|
pajarokillo
Starting Member
12 Posts |
Posted - 2005-08-23 : 13:17:06
|
Ok, i want to accomplish a pagging of the ReportViewer object using Buttons WebControls. That is, in my aspx i have a ReportViewer object that it show a report, and also, a pair of Buttons WebControl for to page the report. I have achieved to page the report forwards and backwards, but i need to know the number of pages the report for to arrive in the end. I don't know if i have explained very well. |
 |
|
gcowhsu
Starting Member
38 Posts |
Posted - 2005-08-23 : 13:34:55
|
The reportviewer already has paging buttons on it, so you should use those. If it's too long you may have to insert page breaks in your tables of the report. Also look at the page size of your actual report. I know what you want to do and I don't think you can do that with reportviewer. A very complex way is to render the report as html and display only like the first 50 lines and then the next 50 lines when they press the arrow buttons.*edit*proofhttp://www.codeproject.com/aspnet/AHCreatRepsAspNet/image008.jpglook at the top left corner it says 1 of 2 and arrow buttons.a bit more clearhttp://www.timkey.net/Synergy04/ReportViewer.jpg1 of 3 with arrow buttons |
 |
|
|
|
|
|
|