March 19, 2012 at 9:06 am
Hi,
I've been looking for a way to display on each page of my report the range of rows displayed.
Ex : "Items 11 to 20 of 34" like we have on this site in the search results pages.
I've done it this way :
- for the min : =(Globals!PageNumber-1)*Parameters!NbPerPage.Value + 1
- for the max : =IIf(Globals!PageNumber*Parameters!NbPerPage.Value < Count(Fields!UD_FILENAME.Value, "DataSet1"), Globals!PageNumber*Parameters!NbPerPage.Value, Count(Fields!UD_FILENAME.Value, "DataSet1"))
- for the total : =Count(Fields!UD_FILENAME.Value, "DataSet1")
But isn't there a more elegant way?
Thanks,
--
jpv
March 19, 2012 at 2:13 pm
I found a solution when I was wanting to display an 'x' number of records on each page.
Dont know if this is what you're looking for but here it is.
Create a new Parent Group on the Details, without header or footer.
Do not select a field, but instead, type in =CEILING(RowNUmber(NOTHING)/1)
When the group is created, go to the properties of the group you just created and click on Sorting.
Delete the sorting that's in that group properties.
Then go to Page Breaks within the same properties and check on 'Between each instance of a group'
Click OK to everything and you should be set.
However, the number "1" within that expression, you change it to the number of records you want. For example, if you want to display 10 records per page, then enter 10 where the 1 is located.
Hope this makes sense. The only issue I have found is that you get a last blank page. Still trying to figure out how to resolve that. Either way, I got what I wanted with this process.
March 19, 2012 at 2:16 pm
just found that last blank page solution.
In the Report Properties, there's an option called ConsumeContainerWhite. Select TRUE and the last page is gone.
March 20, 2012 at 3:15 am
Thanks.
I actually used this post (Reporting Services - Limiting Records Per Page) for the grouping part, and it worked well.
I just wanted to add a text to display more information on each group page.
So I looked for THE method to do it but didn't find any.
That's why i'm posting this.
I modified the formula for the min to display 0 (and not 1) when there's no record found :
=IIf((Globals!PageNumber-1)*Parameters!NbPerPage.Value + 1 < Count(Fields!UD_FILENAME.Value, "DataSet1"), (Globals!PageNumber-1)*Parameters!NbPerPage.Value + 1, Count(Fields!UD_FILENAME.Value, "DataSet1"))
Granted : I could have used "0" and not the "count" for the "else" part, but it's safer this way.
--
jpv
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply