k.Herkt Posted April 25, 2016 Share Posted April 25, 2016 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-tomcatwebappsjasperserverWEB-INFclasses' folderand the 'applicationContext.xml' in the 'apache-tomcatwebappsjasperserverWEB-INF'What do i need?Short form: something like the CSV exporter does ==> no font colors, no wierd column or row size changesbut 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=truesetting:net.sf.jasperreports.export.character.encoding=ISO-8859-1net.sf.jasperreports.default.xls.encoding=ISO-8859-1net.sf.jasperreports.default.xlsx.encoding=ISO-8859-1net.sf.jasperreports.default.csv.encoding=ISO-8859-1[/code]in 'jasperreports.properties' did not helpLong 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 mergingcurrent settings in jasperreports.properties:net.sf.jasperreports.export.xls.column.width=100net.sf.jasperreports.export.xls.collapse.row.span=truenet.sf.jasperreports.export.xls.remove.empty.space.between.columns=falsenet.sf.jasperreports.export.xls.ignore.cell.background=truecom.jaspersoft.jrs.export.xls.paginated=false[/code]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 Link to comment Share on other sites More sharing options...
Solution hozawa Posted April 26, 2016 Solution Share Posted April 26, 2016 Did you set the following property when exporting to csv?net.sf.jasperreports.export.csv.write.bom = true Link to comment Share on other sites More sharing options...
k.Herkt Posted April 26, 2016 Author Share Posted April 26, 2016 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 Link to comment Share on other sites More sharing options...
hozawa Posted April 26, 2016 Share Posted April 26, 2016 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now