Crosstab column group sorting

crosstabireportjasper-reportssorting

I am trying to sort the column group in crosstab but iReport is applying its own sorting by name ascending. I tried inserting "Order By Exp.", but it didn't work. (Field not found error!)

What is the correct way to add our own sorting by field/variable? Or I have presorted data, viewing it as it is will do.

Best Answer

I had a similar problem. I wanted to display a "Heading" from the database, but I did not want it to sort alphabetically since the order of the headings were user determined.

I had a HeadingOrder field that I wanted to sort by. To use it in the sort expression it has to be in the cross tab.

I had heading in my column so made 2 column groups: 1) HeadingOrder 2) Heading.

I removed the text field that displayed the heading order number and collapsed that area so it did not display. This allowed the cross tab to display the Heading while using the HearingOrder field as the dominate sort.