Crystal report Cross-Tab order by another column

crystal-reports

I've made a crosstab in crystal report like below:

enter image description here

However, as you can see, the ordering is weirld (i.e. the correct one should be like below:)

enter image description here

And the ordering is stored in another field called order, I took a look in the crystal report's cross-tab expert sorting option, it doesn't allow me to order by another column, it only allows me to sort either ascending or descending, how can I set the ordering by another column?

Best Answer

Crosstab's sorting is based on the rows order, if you want to sort it in your on you have to add some extra rows and have to suppress subtotal and Label in Customize Style of Crosstab Expert


Example: If you have 3 rows(A,B,C) to display and you have to sort it in order like B,C,A then you have to add 2 new rows(B,C) now your Crosstab looks like (B,C,A,B,C) now you have to suppress Rows B and C you meet your both requirements for sorting and display order


But This solution have some limitations like if you want to export the report in Excel then it will add extra cells in grand total. otherwise you are good to go.


Example: If you have 3 rows(A,B,C) to display and you added one row and you suppress it to solve your sorting issue then in Excel its grand total looks like

A            B            C
a            1            3    
b            2            2
---------------------------
Total:                    3            5

Related Topic