I've made a crosstab in crystal report like below:
However, as you can see, the ordering is weirld (i.e. the correct one should be like below:)
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 tosuppress
subtotal
andLabel
inCustomize Style
ofCrosstab Expert
Example: If you have 3 rows
(A,B,C)
to display and you have to sort it in order likeB,C,A
then you have to add2
new rows(B,C)
now yourCrosstab
looks like(B,C,A,B,C)
now you have to suppressRows B and C
you meet your both requirements forsorting 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