Question

One of our SSRS 2005 reports would time out when executed at the "All" level (was returning upwards of 80K records), so I added a group to the table whose sole purpose was to force a page break after every 500 records. I found the grouping in another post. It looks like this:

=IIF(Fields!ShowPageBreaks.Value = 1, Floor((RowNumber(Nothing) - 1) / 500), Nothing)

The problem is that the user sort no longer works correctly. E.g., "A"s show up at the top of multiple pages. I haven't been able to find any pattern in how SSRS decides to perform the sort. I've tried playing around with the Sort Scope and the Sort Target, like setting one to the Table and one the other to the Group, both to the Table, one or the other to nothing, etc and nothing seems to work.

Has anyone found a solution to a problem like this?

Was it helpful?

Solution

The sorting is happening within each group, aka, "working as intended." You're creating a somewhat arbitrary and random set of record groups based on row position in an un-ordered set.

You need to find a way to sort properly (in the SQL?) prior to applying any sort of grouping, or use a less random means of paging.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top