I am using crosstabs in my report and I want the different row headers in the order that I want and not in the alphabetical order.
e.g. in my table I have the following fields:
------------------------------
Date Product Type Value
------------------------------
1-Sep FNCL 7 87968
1-Sep FNCL 8 9689
1-Sep FGCL 7 1235
1-Sep FGCL 8 1968
1-Sep YGAB 7 1235
1-Sep YGAB 8 1968
Now, in my report, the Date field above is the dynamic column header and my report looks something like:
------------------------------
1-Sep 1-Aug
------------------------------
FGCL
7 1235 ...
8 1968 ...
------------------------------
FNCL
7 87968 ...
8 9689 ...
------------------------------
YGAB
7 1235 ...
8 1968 ...
------------------------------
However, I want the order to be:- FNCL first, then YGAB and then FGCL as my row headers.
i.e. this is what is needed:
------------------------------
1-Sep 1-Aug
------------------------------
FNCL
7 87968 ...
8 9689 ...
------------------------------
YGAB
7 1235 ...
8 1968 ...
------------------------------
FGCL
7 1235 ...
8 1968 ...
------------------------------
How do I achieve this?
In my select query, I tried to put an "order by" clause taking help of another table, but still, I guess Jasper again sorts alphabetically. I dont want Jasper to sort it again.
Please Help.
Thanks in advance.
~Harish.
e.g. in my table I have the following fields:
------------------------------
Date Product Type Value
------------------------------
1-Sep FNCL 7 87968
1-Sep FNCL 8 9689
1-Sep FGCL 7 1235
1-Sep FGCL 8 1968
1-Sep YGAB 7 1235
1-Sep YGAB 8 1968
Now, in my report, the Date field above is the dynamic column header and my report looks something like:
------------------------------
1-Sep 1-Aug
------------------------------
FGCL
7 1235 ...
8 1968 ...
------------------------------
FNCL
7 87968 ...
8 9689 ...
------------------------------
YGAB
7 1235 ...
8 1968 ...
------------------------------
However, I want the order to be:- FNCL first, then YGAB and then FGCL as my row headers.
i.e. this is what is needed:
------------------------------
1-Sep 1-Aug
------------------------------
FNCL
7 87968 ...
8 9689 ...
------------------------------
YGAB
7 1235 ...
8 1968 ...
------------------------------
FGCL
7 1235 ...
8 1968 ...
------------------------------
How do I achieve this?
In my select query, I tried to put an "order by" clause taking help of another table, but still, I guess Jasper again sorts alphabetically. I dont want Jasper to sort it again.
Please Help.
Thanks in advance.
~Harish.
1 Answer:
Posted on September 13, 2006 at 4:18pm
You can do one of the following:
- Specify a comparatorExpression for your row group
- Set the isDataPreSorted flag on the crosstab dataset and change your query to order the data [url=http://jasperreports.sourceforge.net/api/net/sf/jasperreports/crosstabs/...()]as specified here. [/ul]
HTH,
Lucian