Microsoft
Software
Hardware
Network
Question : How to Reset Page Number in SQL Reporting Services for new grouping..
I have create a report using SQL Reporting Services which group by a field. In the report I use a
global field Global!PageNumber for the page number. Is there a way to reset the page number back to 1
if the field grouping change.
Just in case you don't understand. Let say, I have a customer sales report which group by customer.
Everytime when a new customer appear in the report I need the page number to reset back to
1. (i.e. customer A page 1 - 5, customer B page 1 - 5 ) instead of one continuous page number
from 1 to 10.
If you have the solution, please provide sample code and detail explaination.
FYI: I am using SQL Reporting Services standard edition which bundle together with the
SQL Server 2000 Standard Edition.
HELP!!!!!
Answer : How to Reset Page Number in SQL Reporting Services for new grouping..
Workaround #2 (Brian Welcker [MSFT])
Add this to the Code property of the report:
shared offset as integer
public function GetPN(reset as boolean, pagenumber as integer) as integer
if reset
offset = pagenumber - 1
end if
return pagenumber - offset
end function
Use the function in the page number expression, basing the reset property on the presence of something that only appears on the first page of the group.
For example:
="Page " & Code.GetPN(ReportItems!tag
.Value = "Tag",Globals!PageNumber)
Note: To make this work, the offset member variable must be declared as shared. This means the report cannot be run multiple times simultaneously, otherwise the separate runs will smash the shared member variable's value. In addition, failure to access the pages sequentially will have unexpected results (since the shared offset member variable will be set out of order). The only way to use this hack is to schedule runs of the report and save off the rendered results. Users cannot run the report live or even from snapshot history, since pagination occurs when the report is rendered, not when the snapshot is taken.
Random Solutions
Microsoft, Access, 2003, VBA, Make a record found in a recordset the current record of a form
How do I get rid of Sync Issue folders in Outlook 2003?
in Bash's Sort, how do I sort by a second or third field ?
OUTLOOK 2003 RETURNS THIS ERROR MESSAGE WHEN ATTACHING A PDF FILE - MICROSOFT OFFICE WORD, THE OPERATION FAILED
Vista Network Drive - Application Not Found
How to use trusted connection: CR 8.5, VB6, SQL Server
networking xp and vista- xp seeing vista but vista not seeing xp
Textcopy with trusted connection and Windows authentication
Cisco PIX 501 as PPTP Client?
Exc 5.5 Directory Shares