DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: SQL Server Reporting Reset Page count

  1. #1
    Join Date
    Aug 2005

    Talking SQL Server Reporting Reset Page count

    This is for SQL Server Reporting Services.

    I have a report that will come back as 20 pages.

    What the user wants is on the beginning of another unique ID, which causes a new page to be started, to have the page count restart to 1.

    So, if I have 3 UniqueIDs for all 20 pages, and the first, IDAA, is 10 pages long, the second, IDBB, is 4 pages long, and the third, IDCC, is 6 pages long, then the page numbering would be as:
    1-10 for IDAA
    1-4 for IDBB
    1-6 for IDCC

    I know how to do this with Crystal, but am trying to figure it out here with either a page count formula, or some type of distinct count().

    This is what I've tried so far, but it resets on every page.
    So, each page is 1 even if the Unique ID spans 2-3 pages.
    I only need it to reset on a new field grouping of the list object.

    Here's the VB code for 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


    In the header, I have a textbox named "tag"

    In the footer, I've got the following expression:
    ="Unique ID Page: " & Code.GetPN(Not(ReportItems!tag.Value Is Nothing),Globals!PageNumber)

  2. #2
    Join Date
    Aug 2005
    My fault...I had the textbox "tag" in the page header and not in the list object itself.

    It works!


Similar Threads

  1. SQL Server Developer in Calgary Canada
    By Dan Staggs in forum Careers
    Replies: 0
    Last Post: 08-07-2002, 11:04 AM
  2. Replies: 0
    Last Post: 04-29-2002, 07:39 AM
  3. Replies: 1
    Last Post: 07-17-2001, 01:39 AM
  4. SQL server administrative knowledge
    By Becky in forum Database
    Replies: 1
    Last Post: 07-11-2000, 03:27 PM
  5. Re: Sort problem in MS SQL Server 7.0
    By D. Patrick Hoerter in forum Database
    Replies: 1
    Last Post: 06-26-2000, 04:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center