JExcelApiExporterParameter.IS_COLLAPSE_ROW_SPAN

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

bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago

14 Answers:

any Luck guys? I have been struggling with this for a long time. thanks!
bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago
I 'd appreciate if someone can throw some thoughts into this. thanks again !!
bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago

posting again!

bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago

Do you have a full self-contained sample that illustrates this?  I'm afraid I don't understand what the problem is..

Regards,

Lucian

lucianc's picture
87263
Joined: Jul 17 2006 - 1:10am
Last seen: 12 hours 26 min ago

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!

 

bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago

This might be a bug in JasperReports.

I'm attaching a fix attempt.  To deploy the fix, place the attached jar on your application's classpath before the JasperReports jar.

Let me know if this fixes the problem.

Regards,

Lucian

lucianc's picture
87263
Joined: Jul 17 2006 - 1:10am
Last seen: 12 hours 26 min ago

Apparently you can't attach a jar on the forums.  You can get the jar from here.

lucianc's picture
87263
Joined: Jul 17 2006 - 1:10am
Last seen: 12 hours 26 min ago

I want the same jar but i didn't have access to get it. pl. help to get that jar.

jeevananthammca05 - 9 years 11 months ago

The hotfix jar is no longer available.

JR versions starting with 3.5.1 already contain the fix.

lucianc - 9 years 11 months ago

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.

bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago

This fix will be included in the next JR release, for which a date has not been set yet.

I don't know what you are referring to regarding crosstabs.  Please elaborate.

Regards,

Lucian

lucianc's picture
87263
Joined: Jul 17 2006 - 1:10am
Last seen: 12 hours 26 min ago

Thanks so much Lucian. I see that 3.5.0 was released yesterday but I am assuming its not in this release.

Sorry to bug on this but do you think you can provide even a tentative release date? like 1 mont or 2 months?

That will be very helpful.

Thanks again.

bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago

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

bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago
also, would you like me to add these to bugs? I see you already added first issue to Tracker Patch already.
bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago

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

lucianc's picture
87263
Joined: Jul 17 2006 - 1:10am
Last seen: 12 hours 26 min ago
ID 3698 and 3699 filed for these issues. Thanks and looking forward to your next release.
bbharat's picture
204
Joined: Aug 15 2007 - 7:39am
Last seen: 16 years 1 month ago
Feedback