Crosstab column group sorting

user1120946 picture user1120946 · Aug 8, 2012 · Viewed 10.4k times · Source

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.

Answer

Allan picture Allan · Aug 15, 2012

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.