This is a migrated thread and some comments may be shown as answers.

set sorting order from code behind on multiple fields

2 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 30 Mar 2012, 03:29 AM
I am trying to use one report for multiple items. I need to be able to sort the report in code behind on multiple fields.  

                    Dim sorting1 As New Telerik.Reporting.Data.Sorting()
                    sorting1.Expression = "=Fields.DriversLicenseExpiration.Date"
                    sorting1.Direction = Telerik.Reporting.Data.SortDirection.Asc

I found the above in the forums but I can not get it to work and I need to be able to sort on multiple columns  like:

sorting1.Expression = "=Fields.DriversLicenseExpiration.Date; Fields.ProgramGroup" 

2 Answers, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 02 Apr 2012, 12:03 AM
I must of pulled that off an older post. I found this in the documentation and it works fine:

        Dim PassportSorting As New Telerik.Reporting.Data.Sorting()
        PassportSorting.Expression = "=Fields.PassportExpiration.Date"
        PassportSorting.Direction = Telerik.Reporting.Data.SortDirection.Asc
        PassportReport.Sortings.Add(PassportSorting)
0
Ryan
Top achievements
Rank 1
answered on 16 Jan 2013, 09:02 PM
Andy,
What syntax did you use to sub-sort by "Fields.ProgramGroup"?
I am trying to Edit the sorting of my report by using an expression similar to:
= IIf(Parameters.GroupBy1.Value="All",Fields.Category: Fields.id, Fields.id)
So if GroupBy1.Value is "All" I sort first by Fields.Category, then sub-sort by Fields.id. If GroupBy1.Value is anything other than "All", I want to just sort by Fields.id.
Thanks,
Ryan
Tags
General Discussions
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Share this question
or