Monday, 16 July 2012

JasperReport Server Customization - Export JaspReport in Excel Format





JasperReport server provide the facility to export reports in various format like PDF, Excel, CSV and Flash and many more but by default excel export option is disabled in JasperReport server, so if you want to enable excel export option 

Go to this location

<js-install-directory> \apache-tomcat\webapps\jasperserver\WEB-INF\ Applicationcontext.xml

and open Applicationcontext.xml file with notepad and search for the "ignoreGraphics" property


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


Change ignoreGraphic property false to true to export charts in excel format

   <property name="ignoreGraphics" value="true"/>


No comments: