Wednesday, March 21, 2012

Matrix sorting

Hi. I need to implement a matrix that supports column sorting just like a table.
For example, given a matrix that contains...

Col1 Col2
Row1 1 8
Row2 2 6
Row3 3 7

...if the user clicks on "Col2", I need the matrix to look like this:

Col1 Col2
Row2 2 6
Row3 3 7
Row1 1 8

I cannot use the interactive sort feature since the matrix must be WYSIWYG with the printed copy and the built-in interactive sort arrows do appear in printed output.

Here's my partial solution; my hope is that someone can point me in the right direction from here:

When the user clicks on a column heading I will jump to a URL such as:
http://myserver/myreport.aspx?SortField=Col2&SortDirection=Ascending

SortField and SortDirection are parsed by the web app and passed as parameters to my report.

So, after the user clicks on Col2 the report knows the following:
Parameters!SortField.Value = "Col2"
and
Parameters!SortDirection.Value = "Ascending"

Given this information, is there a way to tell the report's matrix to actually display the data in the order shown in the example above.

Thanks for any help you can provide.
Try right click on matrix and select matrix properties, select groups, select edit matrix group, select the sorting tab, change the expression value should be col 12 and direction descending. It worked for me.

No comments:

Post a Comment