Cells merged in Excel file

Hi All,

I have a report comprising main report and four subreports which is meant to be exported to Excel file. Each subreport is shown on separate sheet, for some reazon cells are merged in first column on every sheet. All report elemnts have same wdth and aligned properly. How can I avoid this merging? I tried to  use properties:

<property name="net.sf.jasperreports.export.xls.white.page.background" value="false"/>
 <property name="net.sf.jasperreports.print.keep.full.text" value="true"/>
 <property name="net.sf.jasperreports.export.xls.sheet.names.all" value="Detailed summary/Compute details/Logical storage/Physical storage"/>
 <property name="net.sf.jasperreports.awt.ignore.missing.font" value="true"/>
 <property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
 <property name="net.sf.jasperreports.export.xls.collapse.row.span" value="true"/>
 <property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
 <property name="net.sf.jasperreports.export.ignore.page.margins" value="true"/>

But they do not make any difference.

What am I missing?

Thank you.


tdubovchenko's picture
Joined: Apr 29 2014 - 4:55pm
Last seen: 8 years 11 months ago

2 Answers:

Check the comments on http://community.jaspersoft.com/wiki/xls-export-parameters-jasperreports... to see if that helps.

To see if that helps, at a quick glance your report looks fine in  the allignment, in the XLS expoer it looks like the "Environment" column is the only only one merged. And looking at your JRXML I see that the column header is diferent than the rest it has a textfield that is setting and XLS Column width property (see below) and I think that that one is the culprit.

<reportElement uuid="85f1bec4-a998-4e90-a6ac-ef821325013d" x="0" y="0" width="100" height="40" isPrintWhenDetailOverflows="true">
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<property name="net.sf.jasperreports.export.xls.column.width" value="100"/>
<textElement markup="none"/>
<![CDATA[ "Environment" ]]>



marianol's picture
Joined: Sep 13 2011 - 8:04am
Last seen: 4 years 6 months ago

Thank you for answer!
But removing this property does not help. I noticed that if my first column has width=50, merging does not happen, all sheets are fine. But my first column is a name which could be long...

tdubovchenko - 8 years 11 months ago

I found that expanding the width of the entire report and shifting cells to the right of the area where the merge happens cleaned it up for me. The columns where the merge happened was reduced to 0 in width and empty when I ran the report again. If you don't mind the extra columns being there as they are all but invisible then this solution is confirmed to work. 

athimmig's picture
Joined: Aug 26 2014 - 11:47am
Last seen: 8 years 4 months ago