Export as XLS Problems

0

Hello, i have several problems while exporting my reports (Jasperserver 6.1.0) as an Excel-File.

I tried several settings and properties, but most of them did not help.

Note: i can NOT set the properties in each report, because i have to manage about 25+ reports - and future property-changes would end horrible if i have to set them in each report ...
So i tried to use the 'jasperreports.properties' in the 'apache-tomcat\webapps\jasperserver\WEB-INF\classes' folder
and the 'applicationContext.xml' in the 'apache-tomcat\webapps\jasperserver\WEB-INF'

What do i need?
Short form: something like the CSV exporter does ==> no font colors, no wierd column or row size changes
but i cannot use the CSV exporter, because the encoding does not work for french characters, Umlaute and so on (example: 'Erlöse')
SOLUTION for CSV:  net.sf.jasperreports.export.csv.write.bom=true
setting:

net.sf.jasperreports.export.character.encoding=ISO-8859-1
net.sf.jasperreports.default.xls.encoding=ISO-8859-1
net.sf.jasperreports.default.xlsx.encoding=ISO-8859-1
net.sf.jasperreports.default.csv.encoding=ISO-8859-1

in 'jasperreports.properties' did not help

Long form:
* i would like to disable all kind of formatting (ignore the report specific formatting):
all fonts are black,
all fonts use the same size (in contrast to the normal PDF report)
* no column or row merging


current settings in jasperreports.properties:

net.sf.jasperreports.export.xls.column.width=100
net.sf.jasperreports.export.xls.collapse.row.span=true
net.sf.jasperreports.export.xls.remove.empty.space.between.columns=false
net.sf.jasperreports.export.xls.ignore.cell.background=true
com.jaspersoft.jrs.export.xls.paginated=false

and the 'applicationContext.xml':

<bean id="xlsExportParameters" class="com.jaspersoft.jasperserver.api.engine.jasperreports.common.XlsExportParametersBean">
<property name="detectCellType" value="false"/>
<property name="onePagePerSheet" value="false"/>
<property name="removeEmptySpaceBetweenRows" value="true"/>
<property name="removeEmptySpaceBetweenColumns" value="true"/>
<property name="whitePageBackground" value="false"/>
<property name="ignoreGraphics" value="true"/>
<property name="collapseRowSpan" value="false"/>
<property name="ignoreCellBorder" value="true"/>
<property name="fontSizeFixEnabled" value="false"/>
<property name="maximumRowsPerSheet" value="0"/>
<property name="xlsFormatPatternsMap" ref="formatPatternsMap"/>
</bean>

thanks for help


k.Herkt's picture
11
Joined: Feb 10 2016 - 4:00am
Last seen: 1 year 11 months ago

3 Answers:

2

Did you set the following property when exporting to csv?

net.sf.jasperreports.export.csv.write.bom = true

hozawa's picture
53300
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 2 weeks ago
0

Thank you very much.
This seems to be a good workaround for me.

Is there still a way to set a "default" font and font color for the XLS exporter?
This default setting should overrule the settings in the report because:
 * Some of my reports are using WHITE as font color (some headers), if you export them as XLS you wont see much, because the cells are also white.
 * I also would like to use ONE font size for the XLS export (like the CSV export), even if my report contains several sizes (e.g 12, 16 and 24 with bold)

thank you

k.Herkt's picture
11
Joined: Feb 10 2016 - 4:00am
Last seen: 1 year 11 months ago
0

You'll need to write your own exporter or servlet using JasperReports library to do that. That's what I usually do when properties aren't enough.

hozawa's picture
53300
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 2 weeks ago
Feedback
randomness