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

Crosstab dynamic column sorting

5 Answers 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Katherine
Top achievements
Rank 1
Katherine asked on 17 Jul 2017, 05:39 PM
I have a crosstab with company branch as the row group and invoice month as the column group. Sorting by branch and total works fine, but I can't figure out how to sort by invoice month. I've added a ConditionalSum class as documented here: http://www.telerik.com/blogs/dynamic-sorting-of-reporting-crosstabs-using-a-custom-aggregate-function, but when I set the sort on the crosstab to use the ConditionalSum function it tells me that an aggregate function should not be used in a sort expression. What object do I set the sort on? Is this still the recommended way to accomplish this?

5 Answers, 1 is accepted

Sort by
0
Martin Gartmann
Top achievements
Rank 2
answered on 18 Jul 2017, 06:31 PM

Hi Katherine,
in your crosstab month column group how are the items ordered. Januar, Februar, March, .... or in another form, lets say from A-Z by month names. If you start from a DateTime field the order should be correct by month order. Do you have an "ORDER BY" in your sql query? In case you have a special month column in your table to sort by it could be STRING. Then the A-Z order takes places.

Could you send example data or screenshot.

Kind regards

Martin

0
Katherine
Top achievements
Rank 1
answered on 18 Jul 2017, 06:56 PM

The columns are sorted correctly; however, I want to sort the data within the columns. I attached a screenshot of my crosstab. You can see where I have it sortable by branch and total, but I also want it to be sortable by month.

 

0
Stef
Telerik team
answered on 20 Jul 2017, 03:05 PM
Hello Katherine,

The initial order of columns is determined by the Sortings of the dynamic column group - select the Crosstab item and open the Group Explorer to see the settings.

If you need to use a Sorting Action to change the order of columns, you can make the Corner cell a controlling item and target the column group by name. This video illustrates the suggestion with our Product Sales demo - https://www.screencast.com/t/uWLLu9mXa.


I hope this helps.

Regards,
Stef
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Katherine
Top achievements
Rank 1
answered on 20 Jul 2017, 03:11 PM

Hi Stef,

Again, this is explaining how to sort the columns and not the data within the columns. The columns are in the correct order. I want to make the data in the columns sortable.

0
Stef
Telerik team
answered on 21 Jul 2017, 08:29 AM
Hi Katherine,

The Sorting action can be used for sorting rows as well. The target should be a row group of the Crosstab item, where the sorting criteria can be a field or other expression that does not aggregate data e.g. a numeric field or text field (types which can be sorted).

Please note that the Sorting action replaces previous workarounds for dynamic sorting, and we recommend only the settings from Sorting Table Details.

Regards,
Stef
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Katherine
Top achievements
Rank 1
Answers by
Martin Gartmann
Top achievements
Rank 2
Katherine
Top achievements
Rank 1
Stef
Telerik team
Share this question
or