Jump to content
  • How to display images in the documents that are exported to MS Excel


    akonkin
    • Features: Exporters Product: JasperReports® Library

    For rendering graphics in MS Excel you should use this property:


    net.sf.jasperreports.export.xls.ignore.graphics
    

    If you want to show images in documents that should be exported to MS Excel you should set this property to false.


    You can read more about this property in the JasperReports Configuration reference:


    http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.xls.ignore.graphics


    To define this property in one particular jrxml report you should add to the report’s properties the entry:


    net.sf.jasperreports.export.xls.ignore.graphics=false
    

    If you would like to apply this adjustment to all resources in JasperReports Server (simple jrxml reports, AdHoc based reports, AdHoc Views), the same property should be added to the configuration file,  jasperserver-proWEB-INFapplicationContext.xml.


    Below I quote a snippet that is related to the XLS exporter configuration:


    <!--export parameters-->
    <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="true"/ -->
        <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>
    

    Please also refer to the screenshot that shows this adjustment:


    how_to_show_images_in_xls_documents.png.c83ebdaa5078dcd1c9ae910d4f9e518b.png


    The application server should be restarted to apply the changes that have been done.


    how_to_show_images_in_xls_documents.png.bb29e63c00ea0b2b04454157bf5d1281.png


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...