Export of a report to Excel from JasperReport Server has blank/empty columns

book

Article ID: 224082

calendar_today

Updated On:

Products

CA Service Desk Manager CA Service Management - Service Desk Manager

Issue/Introduction

When the report is exported to excel, blank columns appear. For example column "C" and "I" are empty.

 

Cause

Missing properties in JasperReport server configuration

Environment

Release : 17.3

Component : SDM - Reporting/BOXI/JasperSoft

Resolution

1. In your JasperReports Server installation find /WEB-INF/applicationContext.xml file. (Example: C:\Jaspersoft\jasperreports-server-7.2.0\apache-tomcat\webapps\jasperserver-pro\WEB-INF\applicationContext.xml)

2. In this file find the bean called "xlsExportParameters". Look for the following properties in this bean:

<property name="removeEmptySpaceBetweenRows" value="true"/>
<property name="removeEmptySpaceBetweenColumns" value="true"/>

3. If the properties are not there, do the following:

3.1 Edit: /WEB-INF/classes/jasperreports.properties file
3.2 add the following two lines at the end (if you haven't defined these properties here already):

net.sf.jasperreports.export.xls.remove.empty.space.between.rows=true
net.sf.jasperreports.export.xls.remove.empty.space.between.columns=true

4. Save the file and restart the JasperReport Windows Services.

Additional Information

There are some related links that might be helpful on this matter

https://community.jaspersoft.com/wiki/tips-exporting-excel

https://community.jaspersoft.com/wiki/making-html-xls-or-csv-friendly-reports