Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / September 2006

Tip: Looking for answers? Try searching our database.

HELP - Page break after 2 groups, 2 groups per page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob 'Spike' Stevens - 29 Sep 2006 18:18 GMT
I have a requirement to condense my report length.  Each group is about 40%
of the page length, so 2 per page would fit nicely...

...but I can't figure out a way.  For performance reasons, I have the data
filtered in the table object.

I have tried several things:
1. (Runningvalue(Fields!StoreID.Value,CountDistinct,nothing)-1) \ 2 counts
my groups correctly, but I am not able to use it RunningValue in a SRS
grouping.

2. Created a counter with code found in this newsgroup.  This also counts my
groups correctly, and I can use it in a Group, but it doesnt seem to help me
no matter where I put the IncrelentCounter or GetCounter statements.
  Public GroupRowCounter As Integer = 0

  Function IncrementCounter() As Integer
     GroupRowCounter += 1
     Return GroupRowCounter
  End Function

  Function GetCounter() As Integer
     Return GroupRowCounter
  End Function

3. I've tried putting the Increment in group2 and the Get in group1, and
that didnt help.  I tried putting the increment in group1 and the get in
group2 and nothing changes. I admit I may be putting the Increment and Get in
the wrong places, but I can't seem to see it.

Can anyone help me?
Rob 'Spike' Stevens - 29 Sep 2006 23:49 GMT
Ok, I found a way, and thought I'd shart

> I have a requirement to condense my report length.  Each group is about 40%
> of the page length, so 2 per page would fit nicely...
[quoted text clipped - 27 lines]
>
> Can anyone help me?
Rob 'Spike' Stevens - 29 Sep 2006 23:55 GMT
Ok, I figured it out, and thought I would share it with you.

1.  Placed code below in the Code section of your report properties:

Public GroupRowCounter As Integer = 0
Public GroupName as string =""'

Function IncrementCounter(strGroup as string) As string

   if GroupName <>  strGroup then
     GroupRowCounter += 1
     GroupName = strGroup
  end if

   Return (GroupRowCounter -1)\2

End Function

2. In the dataset for you Report, add a calculated field, I called mine
Grouper.

3. Code.IncrementCounter(Fields.TheOneYoureTryingToGroupNperPage.value)

4. On your report, add a group immideately above the group level you want
per page using Grouper.  Set page break at end.  

5. Remove page breaks from any internal grouping that no loner need them.

> I have a requirement to condense my report length.  Each group is about 40%
> of the page length, so 2 per page would fit nicely...
[quoted text clipped - 27 lines]
>
> Can anyone help me?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.