all groups > sql server reporting services > september 2006 >
You're in the

sql server reporting services

group:

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



HELP - Page break after 2 groups, 2 groups per page Rob 'Spike' Stevens
9/29/2006 10:18:02 AM
sql server reporting services: 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?
RE: HELP - Page break after N groups, 2 groups per page Rob 'Spike' Stevens
9/29/2006 3:49:01 PM
Ok, I found a way, and thought I'd shart

[quoted text, click to view]
RE: HELP - Page break after N groups, N groups per page Rob 'Spike' Stevens
9/29/2006 3:55:02 PM
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.



[quoted text, click to view]
AddThis Social Bookmark Button