Reputation: 11
I have a report with text field and this text can be long and it is wrapped. When I export report to .xls
from JasperReports
it is ok with this cell - i get wrapped text in one cell. But when I export to .xlsx
JR adds one more excel row after row with wrapped text and merges wrapped cell with cell below.
The result for .xls
import is:
and the result for .xlsx
import is:
I have tried different options of JR export - no result (I put this options into report, not into config files, may be this is important?)
JasperServer
version is not the latest? may be 3.x
Upvotes: 1
Views: 10494
Reputation: 27
pt_BR: Aqui, eu resolvi com algumas <property />
de exportação do .xlsx e com a alteração da propriedade do TextField Stretch With Overflow
desmarcada (false
).
en_US: Here, I solved with some <property />
to export .xlsx and changed the TextField property Stretch With Overflow
to false
(unchecked).
JRXML:
...
<property name="net.sf.jasperreports.print.keep.full.text" value="true"/>
<property name="net.sf.jasperreports.export.xls.wrap.text" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
...
Upvotes: 0
Reputation: 1
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.
You should be able to do this using the rows as well but expanding the height of the report and leaving that area blank but moving everything else down a cell in size.
Upvotes: 0
Reputation: 14202
The reason for that is the cell that is wrapping is increasing its height to fit the text, while the other cells in the same row are not doing the same thing. You should try setting the Stretch Type
to Relative to Tallest Object
and see if that helps.
As far as why it happens on xlsx and not xls, I don't have a clue.
Upvotes: 2