Reputation: 667
I have a SSRS 2008 report that generated columns of the months along with other data based on year halves. I have the tablix column group and sort set for [Mon] and the first half of the year generated just fine but when I run the report for the second half it does not display in order :
MonthNumber 10 11 12 7 8 9
MonthName October Movember December July August September
The SQL code that is used generated the following rows which appear in order of month number.
Mon
7
8
9
10
11
12
Upvotes: 2
Views: 559
Reputation: 39566
I would say that Mon
is being treated as a string value, for whatever reason, i.e. from the query or in the dataset definition, as you can see that in your example the columns are being sorted as strings, i.e. 10 will be before 7 when sorted as text and not numeric values.
You have two options:
First is to sort by an expression like: =CInt(Fields!Mon.Value)
, i.e. explicitly sorting as an integer, which solve the issue if Mon
is being treated as text.
The other option is to make sure that Mon
is being treated as an integer at the dataset level - either way should be fine.
Upvotes: 1