15

I've got an RDLC report that looks great, but strangely the data is not sorted the way I specified in the XSD file that I'm using as a DataSource. When I "Preview Data" in the XSD file, it is sorted correctly.

I can't find any setting that would be overwriting the sort order of the data in either my calling ASP file or the RDLC file and am stumped. I may try manually sorting the data, but it seems like it shouldn't be this difficult.

Thanks for any pointers you have.

SaltyDog
  • 323
  • 1
  • 3
  • 6

4 Answers4

12

It has been a while, but the report also has a sort option somewhere. You may want to be sure that matches.

Mike Wills
  • 20,959
  • 28
  • 93
  • 149
  • 3
    Mike, thank you! Sometimes it takes only the slightest nudge to get me looking in the right place. I opened the RDLC in the text editor to view the XML, searched for Sort, and found that the main tablix was groupExpression also had sortExpression. That was essentially controlling the sort order of the entire report. – SaltyDog Sep 07 '11 at 15:11
  • That is what I hoped would work. Mark as answer if this fixed it. – Mike Wills Sep 07 '11 at 15:22
  • How to sort by decending? – Jigar Joshi Dec 28 '17 at 12:19
9

This is old, but I found that in the report designer there's multiple places to check the sorting configuration.

Tablix Properties and Group Properties both have sorting options which may be conflicting.

enter image description here

Ben Winding
  • 10,208
  • 4
  • 80
  • 67
4

Using the Report Designer, you should be able to do that.

On the Header Column, Right-Click, Textbox Properties, Sorting

http://msdn.microsoft.com/en-us/library/ms251728(v=vs.80).aspx

0

I faced the same problem, my query was returning the proper order, also I applied order while binding data to the model, still my rdlc report was showing data in a different order. The issue is if the .rdlc report has a group already, it will replace the previous order and will apply a new sorting on its own (if not mentioned any).

For changing the default setting, as sorting occurs in each group differently that's why click on the group where you want to apply your desired sorting, then from the bottom panel select the group like this image:

enter image description here

and then right-click on it, It will show Group Properties, click on that, a window will appear, go to the sorting option like below image and sort according to your requirements.

enter image description here

TBA
  • 1,921
  • 4
  • 13
  • 26