SSRS 2005: Reset group page numbers, view xx from xx

In SQL Server 2005 Reporting Services, I printed a form (for example, invoice), which can be multi-page. I need to print a lot of such forms (for example, everything invoicesfor the specified client and for a certain period) with one click. I put the layout in a table and grouped all the information by the account number, so everything is fine for the entire printed form, I have what I want. For everyone except pagination. Each invoice, if multi-page, should have a numbering on the footer page, for example page xx from xx.

Can I calculate the total number of pages for a group?

+3
source share
1 answer

Blog post Reset The page number in the group describes how to reset the page number at the end of each group. This requires a small custom code function and expression for the page number.

Briefly (cited in the article):

Step 1. Verify that the report contains a text box that contains a group expression

Step 2: add shared variables to track the current group and page Offset

Shared offset as Integer
Shared currentgroup as Object

Step 3. Add a custom function to set shared variables and get the group page number

 Public Function GetGroupPageNumber(group as Object, pagenumber as Integer) as Object
   If Not (group = currentgroup)
     offset = pagenumber - 1
     currentgroup = group
   End If
   Return pagenumber - offset
 End Function

Step 4: Use the function in the page header or footer

=Code.GetGroupPageNumber(ReportItems!Category.Value,Globals!PageNumber)

SSRS 2008 - , , : MSDN - reset

+7

Source: https://habr.com/ru/post/1723853/


All Articles