Jump to content
JasperReports Library 7.0 is now available ×
  • XLS Export Parameters in JasperReports Server


    djohnson53
    • Features: Exporters Version: v5.0 Product: JasperReports® Server

    XLS Export Parameters

    JasperReports Server is shipped with a default configuration that produces a data-centric Excel output where graphic elements are ignored, spacer cells are removed and the data type of cells is preserved.

    Property NameDefaultDescription
    detectCellTypetruePreserve the type of the original text field expressions and use it for the cell data type
    onePagePerSheetfalseEach report page should be written in a different XLS sheet
    removeEmptySpaceBetweenRowstrueEmpty spaces that could appear between rows should be removed or not.
    removeEmptySpaceBetweenColumnstrueEmpty spaces that could appear between columns should be removed or not.
    whitePageBackgroundfalseForce cell white background
    ignoreGraphicstrueExport text elements only
    collapseRowSpantrueCollapse row span and avoid merging cells across rows
    ignoreCellBordertrueDo not draw the cell border
    fontSizeFixEnabledtrueDecrease font size so that texts fit into the specified cell height
    maximumRowsPerSheet0Maximum number of rows allowed before continuing on a new sheet

    In report templates, Java specific format patterns are used to format dates and numbers (see JasperReports documentation for details). But these patterns might not work inside the Excel document viewer program, as their syntax might not be fully supported there.

    In such cases, the Java format patterns have to be converted to equivalent proprietary format patterns using the formatPatternsMap bean inside the WEB-IN/applicationContext.xml file, where pairs of equivalent patterns can be added.

    How the various XLS exporting properties are structured in the the WEB-IN/applicationContext.xml file:

    <bean ...="" id="xlsExportParameters">
        <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="collapseRowSpan" value="true" />
        <property name="ignoreCellBorder" value="true" />
        <property name="fontSizeFixEnabled" value="true" />
        <property name="maximumRowsPerSheet" value="0" />
        <property name="xlsFormatPatternsMap" ref="formatPatternsMap" />
    </bean>
    <util:map id="formatPatternsMap">
        <!-- entry key="¤ #,##0.00" value="$ #,##0.00"/ -->
    </util:map>
    


    See Also:


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...