Hi,
I am using crosstab in my report and I am having problem with the data it displays. It repeats the column on the report when I use 'Data is pre-sorted' flag on crosstab. Please check the image attached.
When I uncheck the 'Data is pre-sorted' box, I get the columns correctly but the rows are ordered alphabetically whereas I want rows in the order shown in the image.
The data passed to the crosstab via Dataset is:
The sorting order I am using at the moment is:
ORDER BY display_order ASC, block_schedule_ID ASC;
Can anyone please help. Thanks.
- Log in or register to post comments
5 Answers:
I managed to get this working. I realised that the dataset returned via my SQL queries were not having entry for each columns e.g. I was having a row returned for COLUMN 1 and COLUMN 2 for ROW1 but then onwards I was either having a row returned for COLUMN 1 or a row returned for COLUMN 2 by my SQL. Something like
General Expenditure Internal Only
General Repairs 5 5
Cleaning 5
Accountancy 5
Insurance 5
and so on ....
I changed my SQL query so it returns 0 if there is no data to be retrieved for COLUMN 1 or COLUMN 2 and that made it working in the sorting order I want havin the 'Data is pre-sorted' flag checked for the crosstab. LIKE
General Expenditure Internal Only
General Repairs 5 5
Cleaning 5 0
Accountancy 0 5
Insurance 5 0
Hope this is helpful for others.
Thanks for your reply lucianc
Here are the files attached. The report file is attached as .TXT file as the forum didn't allowed me to upload the JRXML format file. I have also attached the CSV data files which is used with main report SQL and sub-dataset SQL. Hope to hear soon. Thanks.
/sites/default/files/files/Report%20File.txt
We have identified a bug that affects crosstabs with isDataPreSorted set. Please log it in the trackers.
You can simulate the presorted flag by wrapping group bucket values in objects that preserves the original order of the values. See attached Java class. To use it, reset the isDataPreSorted flag and then use something like new OrderedValue($F{service_name}, $V{REPORT_COUNT}) as bucket expressions for the groups where you want the order preserved.
/sites/default/files/files/OrderedValue_java.txt
Regards,
Lucian
I am unable to try this as we are using Jasper with our PHP application and I have linux server ... I will have issues getting this working on our server .... but I managed to get this working after tweaking my SQL query that I use to retrieve my data. Thanks for your help anyway.
same problem was 1,5 year ago. i cant open page http://jasperforge.org/plugins/mantis/view.php?id=5281
Hello frds,
Iam new @jasper Report.....i have one requirement ,,,iam enable to get any blog for this so plz help meeeeeee
My requirment is .......i want to do SubTotal for more than 2 rows .So iam unable to get this .Soooo plz help and send step how to do this...
Plz check below attached Excel File like tht i want output............Iam waiting for Your Reply.
Attachment | Size |
---|---|
![]() | 16 KB |