Reputation: 4919
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?
Upvotes: 0
Views: 8239
Reputation: 1
Use the order field as the grouping column and change the label for said column to show the actual sizes. The labels can be changed in Crosstab Expert
, Grouping Options
and then the tab Options
.
Upvotes: 0
Reputation: 176
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
Upvotes: 1
Reputation: 3
Make the field you want to sort by a group field and hide it. To hide it, in the Crosstab Expert > Customize Style dialog select this group then use the Group Options area to Suppress Subtotal and Supress Label. Worked for me.
Upvotes: 0
Reputation: 9101
Simple way would be take order column from stored procedure to cross tab and set the order according to that column.
Then supress the order column and reduce the width of that column to minimum pixel so that it doesn't appear in cross tab.
Upvotes: 1
Reputation: 659
open crosstab expert
, highlight the column that you want to reorder, go to Group Options
and select in specified order
. This will open another tab where you will have your available values listed there. Using the arrows on the right side you can move up or down your values and accommodate them in the order you want them to be displayed.
Upvotes: 1
Reputation: 5798
Yes, you can not sort on another column. You must use any of one column as a header.
In Crystal report, sorting happened based on header column's value (That's why you see as per alphabetic).
I also face this issue and how I solved, that I am explain. You have to use a formula which have order, but either hide it or use a value like in this link.
https://scn.sap.com/thread/3341846
Second option as per this link. (I think first you check this)
http://www.codeproject.com/Tips/493334/Custom-sorting-for-Crystal-Report-Cross-Tab
https://scn.sap.com/thread/1172741
Upvotes: 1