I am using this property in my view to merge/collapse cells when data in adjacent cell grows.
exporter.setParameter(JExcelApiExporterParameter.IS_COLLAPSE_ROW_SPAN, Boolean.TRUE);
See the FIRST screenshot attached. If I set this property TRUE in my view, all these cells align perfectly. but if you notice the EXCEL TOOLBAR "Merge and Center" button is highlighted indicating there are some hidden merge cells. You cant see these merged cells becasuse of this property but its there since it doesnt let you sort.
When you mark this property false, it then shows you all those hidden cells, see 2nd screenshot attached.
Looks like a bug in jasper where when you set this property TRUE, it collapses the cells but fails to indicate excel tht there are really no merge cells.
Any clues or suggestions?
Thanks very much
14 Answers:
So heres the snipper of my xls view class which is setting following property:
------------------------------------
exporter.setParameter(JExcelApiExporterParameter.IS_COLLAPSE_ROW_SPAN,Boolean.TRUE);
------------------------------------
when I do this, report comes up fine with no "visible" merged cells. (IN EXCEL)
but at the same time, excel highlights the button under MS EXCEL toolbar ie, "MERGE AND CENTER" suggesting that there are HIDDEN MERGED CELLS and untill you sort that out or CLICK THIS BUTTON, you will not be able to sort the report.
screenshot name: good
---------------------
Now, when you change the property to false:
exporter.setParameter(JExcelApiExporterParameter.IS_COLLAPSE_ROW_SPAN,Boolean.FALSE);
you can see that there are still cell merging going on. Not sure why. Screenshot name "bad"
Thanks!
Apparently you can't attach a jar on the forums. You can get the jar from here.
Perfect, works like a charm. This took care of that merge and center highlight issue.
Do you have a date of release of the new API? Also, will that include how crosstab handles null, empty string or empty space string? currently it brings the entire crosstab length cell in the report.
Thanks very much Lucian.
So the list of issues which will be awesome to have in the next release:
- XLS hidden merging of cells which you just fixed for us. :)
- Crosstab fills empty cell(when no data ie, null) with a cell of width of the entire crosstab. I tried suppressing that null with a empty string ie, "" but still crosstab will insert a empty cell of width =crosstab width thereby screwing the entire xls report. I also tried adding "<empty spaces>" as a teranary operator in properties but it still didnt work.
XLS copy attached. You will see that I have a simple crosstab with 2 questions on column and "yes" and "No" as answers from different ppl. When the report shows up, you will that ROW 4, 5, 6 dont have any answers so instead of printing blank with same cell size, it spits the entire crosstab width cell and thereby pushing other data.
---------------------------------------------
Please let me know if you want more info or its not clear. I ll try to get you a better example.
Thanks very much
Bharat
No, the fix did not make it in JR 3.5. I still can't give you an estimate for the date of the next release, it will probably happen within 2 months as that's the average JR release cycle.
Please do log bugs for all these issues, including the one for which I sent you the hotfix.
Regards,
Lucian
I want the same jar but i didn't have access to get it. pl. help to get that jar.
The hotfix jar is no longer available.
JR versions starting with 3.5.1 already contain the fix.