Interface XlsReportConfiguration

    • Field Detail

      • PROPERTY_ONE_PAGE_PER_SHEET

        static final java.lang.String PROPERTY_ONE_PAGE_PER_SHEET
        Property whose value is used as default state of the isOnePagePerSheet() export configuration flag.

        This property is by default not set (false).

        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_IGNORE_GRAPHICS

        static final java.lang.String PROPERTY_IGNORE_GRAPHICS
        Property whose value is used as default state of the isIgnoreGraphics() export configuration flag.

        This property is by default not set (false).

        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_COLLAPSE_ROW_SPAN

        static final java.lang.String PROPERTY_COLLAPSE_ROW_SPAN
        Property whose value is used as default state of the isCollapseRowSpan() export configuration flag.

        This property is by default not set (false).

        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_PASSWORD

        static final java.lang.String PROPERTY_PASSWORD
        Property whose value is used as default value of the getPassword() export configuration setting.

        This property is by default not set (null).

        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_SHEET_NAMES_PREFIX

        static final java.lang.String PROPERTY_SHEET_NAMES_PREFIX
        Prefix used to identify properties holding sheet names. Such properties are useful when defining sheet names in the JRXML template is required. The property values are collected in an ordered list, therefore the order in which the properties appear in the report is important. If set, the values are used as defaults for the getSheetNames() export configuration setting.

        A property starting with this prefix can hold one or several sheet names, separated by a slash character ("/").

        By default no sheet name properties are set.

        See Also:
        JRPropertiesUtil, Constant Field Values
      • FORMAT_PATTERN_PREFIX

        static final java.lang.String FORMAT_PATTERN_PREFIX
        Properties having net.sf.jasperreports.export.xls.pattern. prefix are used to store specific Excel format patterns that correspond to their related Java format pattern. The {arbitrary_pattern} suffix represents the Java pattern and the property value is the related Excel pattern. When these properties are defined in a JRXML report design, special characters should be XML-escaped. When they are defined in a properties file, one should also escape special characters. If some properties are defined in the report, they will override the context properties.
        See Also:
        Constant Field Values
      • PROPERTY_IGNORE_HYPERLINK

        static final java.lang.String PROPERTY_IGNORE_HYPERLINK
        Property that provides a default value for the isIgnoreHyperlink() export configuration flag.
        See Also:
        Constant Field Values
      • PROPERTY_IGNORE_ANCHORS

        static final java.lang.String PROPERTY_IGNORE_ANCHORS
        Property that provides a default for the isIgnoreAnchors() export configuration flag. The default value is false.

        Property scope:

        • Global
        • Report
        See Also:
        Constant Field Values
      • PROPERTY_PAGE_SCALE

        static final java.lang.String PROPERTY_PAGE_SCALE
        This property provides a default value for the getPageScale() export configuration setting.
        Property scope:
        • Global
        • Report
        • Element - this setting can be used to set the page scale per sheet
        Global settings are overridden by report level settings; report level settings are overridden by element (sheet) level settings.
        See Also:
        Constant Field Values
      • PROPERTY_SHEET_DIRECTION

        static final java.lang.String PROPERTY_SHEET_DIRECTION
        This property provides a default for the getSheetDirection() exporter configuration setting.
        See Also:
        Constant Field Values
      • PROPERTY_FREEZE_ROW

        static final java.lang.String PROPERTY_FREEZE_ROW
        This property provides a default for the getFreezeRow() exporter configuration setting. Allowed values are represented by positive integers in the 1..65536 range. Negative values are not considered. The property should be used when all sheets in the document have the same freeze row index.
        See Also:
        Constant Field Values
      • PROPERTY_FREEZE_COLUMN

        static final java.lang.String PROPERTY_FREEZE_COLUMN
        This property provides a default for the getFreezeColumn() exporter configuration setting. Allowed values are letters or letter combinations representing valid column names in Excel, such as A, B, AB, AC, etc. The property should be used when all document sheets have the same freeze column name.
        See Also:
        Constant Field Values
      • PROPERTY_COLUMN_WIDTH_RATIO

        static final java.lang.String PROPERTY_COLUMN_WIDTH_RATIO
        Property used to provide a default value for the getColumnWidthRatio() export configuration setting. The property can be set:
        • globally - then all the columns in all documents exported to the Excel output format will be adjusted with the same width ratio
        • at report level - then all the columns in the document will be adjusted with the same width ratio
        • at element level - then all the columns in the current sheet will be adjusted with the same width ratio
        If present, a PROPERTY_COLUMN_WIDTH property will override the PROPERTY_COLUMN_WIDTH_RATIO value for that column only.
        See Also:
        ExcelAbstractExporter.PROPERTY_COLUMN_WIDTH, JRPropertiesUtil, Constant Field Values
      • PROPERTY_USE_TIMEZONE

        static final java.lang.String PROPERTY_USE_TIMEZONE
        Property that provides a default for the isUseTimeZone() export configuration flag. The property can be set globally, at report level and at element level. The default value is false.
        Since:
        4.5.0
        See Also:
        Constant Field Values
      • PROPERTY_FIRST_PAGE_NUMBER

        static final java.lang.String PROPERTY_FIRST_PAGE_NUMBER
        Property that specifies the default for the getFirstPageNumber() exporter configuration setting.
        Property scope:
        • Global
        • Report
        • Element - this setting can be used to set the first page number per sheet.
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_SHOW_GRIDLINES

        static final java.lang.String PROPERTY_SHOW_GRIDLINES
        Property that provides a default for the isShowGridLines() export configuration flag. When set at report element level and multiple elements in a sheet provide this property, the last read value will be considered. Default value is true.
        Property scope:
        • Global
        • Report
        • Element - this setting can be used to set the property value per sheet.
        Global settings are overridden by report level settings; report level settings are overridden by element (sheet) level settings.
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_IMAGE_ANCHOR_TYPE

        static final java.lang.String PROPERTY_IMAGE_ANCHOR_TYPE
        Property that provides a default value for the getImageAnchorType() export parameter setting. Possible values are:
        • MoveSize - images move and size with cells
        • MoveNoSize - images move but don't size with cells
        • NoMoveNoSize - images don't move or size with cells
        Default value is MoveNoSize.
        Property scope:
        • Global
        • Report
        • Element
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_AUTO_FIT_PAGE_HEIGHT

        static final java.lang.String PROPERTY_AUTO_FIT_PAGE_HEIGHT
        Flag property that provides a default value for the isAutoFitPageHeight() export setting. If set to true, the exporter will automatically fit the print height of a sheet to the number of JasperPrint pages exported in that sheet
        Property scope:
        • Global
        • Report
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_FORCE_PAGE_BREAKS

        static final java.lang.String PROPERTY_FORCE_PAGE_BREAKS
        Flag property that provides a default value for the isForcePageBreaks() export setting. If set to true, the exporter will automatically add a page break at the end of each page exported on the current sheet.
        Property scope:
        • Global
        • Report
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_SHRINK_TO_FIT

        static final java.lang.String PROPERTY_SHRINK_TO_FIT
        This flag property serves as default for the isShrinkToFit() export configuration flag.

        If set to true, this will automatically disable the wrap text setting for the cell (see isWrapText()).

        Usually this property works in conjunction with net.sf.jasperreports.print.keep.full.text, in order to preserve the entire text content at export time.

        The property itself defaults to false.

        Property scope:

        • Global
        • Report
        • Element
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_IGNORE_TEXT_FORMATTING

        static final java.lang.String PROPERTY_IGNORE_TEXT_FORMATTING
        Property whose value is used as default state of the isIgnoreTextFormatting() export configuration flag. If true, text elements will be exported without formatting features such as bold, underline, backcolor, text color, etc.

        Property scope:

        • Global
        • Report
        • Element
        This property is by default not set (false).
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_SHEET_TAB_COLOR

        static final java.lang.String PROPERTY_SHEET_TAB_COLOR
        Property whose value is used as default state of the getSheetTabColor() export configuration setting.

        When set at report element level and multiple elements in a sheet provide this property, the last read value will be considered. The property works in XLSX and ODS output formats. It is not supported by the XLS output format.

        Property scope:

        • Global
        • Report
        • Element - this setting can be used to set the property value per sheet.
        Global settings are overridden by report level settings; report level settings are overridden by element (sheet) level settings.
        See Also:
        JRPropertiesUtil, Constant Field Values
      • PROPERTY_DEFINED_NAMES_PREFIX

        static final java.lang.String PROPERTY_DEFINED_NAMES_PREFIX
        Property prefix used to identify a set of properties that store defined names for the generated Excel workbook. Each property suffix serves as name identifier and should be in accordance with the following rules:
        • the first character in a name should be a letter, an underscore or a backslash
        • the remaining characters may be letters, digits, periods or underscores; spaces are not allowed
        • a name cannot represent a cell reference (names like "A10", "$A$10" or "R2C5" are invalid)
        • a name cannot exceed 255 characters
        • names are not case sensitive: "name1", "Name1" and "NAME1" represent the same name
        • a name identifier should be unique within a given report, in order to be properly collected at export time
        The value of such a property contains two distinct parts, separated by a pipe ("|") sign:
        • the first part, which is mandatory, may represent:
          • a cell reference in a given sheet (such as "Sheet_1!$A$10", "Sheet_1!A10", or "'Sheet 1'!$A$10"); the "A10" cell reference is relative, while "$A$10" is absolute
          • a cell range reference in a given sheet (such as "Sheet_1!A10:C20", "Sheet_1!$A$10:$C$20", "'Sheet 1'!$A$10:$C$20")
          • a formula (such as "SUM('Sheet 1'!$A$10:$C$20)")
          Note: the R1C1 Excel reference style is not supported in a cell reference, cell range or formula.
        • an optional second part represents the scope for the defined name. It can be either a sheet name, or the "workbook" literal constant, representing the entire workbook. In case this second part is missing, the scope associated by default will be the entire workbook.

        Examples:

        • <property name="net.sf.jasperreports.export.xls.defined.names.test_sum" value="SUM(Sheet_1!$A$10:$C$20)|SecondSheet"/>

        This name, identified as "test_sum", is visible only in a sheet named "SecondSheet" and is associated with a formula that calculates a sum over the cell range [$A$10:$C$20] belonging to a sheet named "Sheet_1".

        • <property name="net.sf.jasperreports.export.xls.defined.names.test_range" value="'Sheet 1'!$A$10:$C$20"/>

        This name, identified as "test_range", is visible in the entire workbook and is associated with the cell range [$A$10:$C$20] in the sheet named "Sheet 1".

        • <property name="net.sf.jasperreports.export.xls.defined.names.test_sum_1" value="SUM(Sheet_1!$A$10:$C$20)|Sheet_1"/>
        • <property name="net.sf.jasperreports.export.xls.defined.names.test_sum_all" value="Sheet_1!test_sum_1"/>

        In this case the name test_sum_1 is visible only in the sheet named Sheet_1.

        The name test_sum_all is visible in the entire workbook and refers to the name test_sum_1 defined for Sheet_1.

        Note: Names that reference other names with limited visibility/scope (like the above test_sum_all) are NOT supported for the XLS (Excel 2003) export format. They work only in the XLSX (Excel 2007 or newer) exporter.

        See Also:
        JRPropertiesUtil, Rules for Excel defined names, Constant Field Values
    • Method Detail

      • isOnePagePerSheet

        java.lang.Boolean isOnePagePerSheet()
        Returns a boolean value specifying whether each report page should be written in a different XLS sheet.
        See Also:
        PROPERTY_ONE_PAGE_PER_SHEET
      • isRemoveEmptySpaceBetweenRows

        java.lang.Boolean isRemoveEmptySpaceBetweenRows()
        Returns a boolean value specifying whether the empty spaces that could appear between rows should be removed or not.
        See Also:
        PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS
      • isRemoveEmptySpaceBetweenColumns

        java.lang.Boolean isRemoveEmptySpaceBetweenColumns()
        Returns a boolean value specifying whether the empty spaces that could appear between columns should be removed or not.
        See Also:
        PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS
      • isWhitePageBackground

        java.lang.Boolean isWhitePageBackground()
        Returns a boolean value specifying whether the page background should be white or the default XLS background color. This background may vary depending on the XLS viewer properties or the operating system color scheme.
        See Also:
        PROPERTY_WHITE_PAGE_BACKGROUND
      • isDetectCellType

        java.lang.Boolean isDetectCellType()
        Flag used to indicate whether the exporter should take into consideration the type of the original text field expressions and set the cell types and values accordingly.

        Text fields having numerical or date expressions save type and formatting (format pattern, locale and time zone) information in the JasperPrint/JRPrintText object created by the report fill process.

        When this flag is set, the exporter will parse back the String value of numerical/date texts. Numerical/date cells will be created and the original pattern of the text will be included as part of the cell style.

        Note that this mechanism would not work when the text field overflows and splits on two pages/columns. Also, it is required that the text field expression has a numerical or date type set.

        This flag is off by default to ensure backwards compatibility.

        See Also:
        PROPERTY_DETECT_CELL_TYPE
      • isFontSizeFixEnabled

        java.lang.Boolean isFontSizeFixEnabled()
        Flag for decreasing font size so that texts fit into the specified cell height.
        See Also:
        PROPERTY_FONT_SIZE_FIX_ENABLED
      • isImageBorderFixEnabled

        java.lang.Boolean isImageBorderFixEnabled()
        Flag for forcing the minimum image padding to 1 pixel, to avoid situations where the image hides the cell border.
        See Also:
        PROPERTY_IMAGE_BORDER_FIX_ENABLED
      • isIgnoreGraphics

        java.lang.Boolean isIgnoreGraphics()
        Flag for ignoring graphic elements and exporting text elements only.
        See Also:
        PROPERTY_IGNORE_GRAPHICS
      • isCollapseRowSpan

        java.lang.Boolean isCollapseRowSpan()
        Flag for collapsing row span and avoid merging cells across rows.
        See Also:
        PROPERTY_COLLAPSE_ROW_SPAN
      • isIgnoreCellBackground

        java.lang.Boolean isIgnoreCellBackground()
        Flag for ignoring the cell background color.
        See Also:
        PROPERTY_IGNORE_CELL_BACKGROUND
      • isWrapText

        java.lang.Boolean isWrapText()
        This flag indicates whether text wrapping is allowed in a given cell.
        See Also:
        PROPERTY_WRAP_TEXT
      • isCellLocked

        java.lang.Boolean isCellLocked()
        This flag indicates whether the cell is locked.
        See Also:
        PROPERTY_CELL_LOCKED
      • isCellHidden

        java.lang.Boolean isCellHidden()
        This flag indicates whether the cell content is hidden.
        See Also:
        PROPERTY_CELL_HIDDEN
      • getMaxRowsPerSheet

        java.lang.Integer getMaxRowsPerSheet()
        Returns an integer value specifying the maximum number of rows allowed to be shown in a sheet. When set, a new sheet is created for the remaining rows to be displayed. Negative values or zero means that no limit has been set.
        See Also:
        PROPERTY_MAXIMUM_ROWS_PER_SHEET
      • isIgnorePageMargins

        java.lang.Boolean isIgnorePageMargins()
        Indicates whether page margins should be ignored when the report is exported using a grid-based exporter

        If set to true, any page in the document will be exported without taking into account its margins.

        See Also:
        ReportExportConfiguration.PROPERTY_IGNORE_PAGE_MARGINS
      • getSheetHeaderLeft

        java.lang.String getSheetHeaderLeft()
        This property stores the text content of the sheet header's left side.
        See Also:
        PROPERTY_SHEET_HEADER_LEFT
      • getSheetHeaderCenter

        java.lang.String getSheetHeaderCenter()
        This property stores the text content of the sheet header's center.
        See Also:
        PROPERTY_SHEET_HEADER_CENTER
      • getSheetHeaderRight

        java.lang.String getSheetHeaderRight()
        This property stores the text content of the sheet header's right side.
        See Also:
        PROPERTY_SHEET_HEADER_RIGHT
      • getSheetFooterLeft

        java.lang.String getSheetFooterLeft()
        This property stores the text content of the sheet footer's left side.
        See Also:
        PROPERTY_SHEET_FOOTER_LEFT
      • getSheetFooterCenter

        java.lang.String getSheetFooterCenter()
        This property stores the text content of the sheet footer's center.
        See Also:
        PROPERTY_SHEET_FOOTER_CENTER
      • getSheetFooterRight

        java.lang.String getSheetFooterRight()
        This property stores the text content of the sheet footer's right side.
        See Also:
        PROPERTY_SHEET_FOOTER_RIGHT
      • getPassword

        java.lang.String getPassword()
        Returns a String value representing the password in case of password protected documents.
        See Also:
        PROPERTY_PASSWORD
      • getSheetNames

        java.lang.String[] getSheetNames()
        Returns an array of strings representing custom sheet names. This is useful when used with the isOnePagePerSheet() setting.
        See Also:
        PROPERTY_SHEET_NAMES_PREFIX
      • getFormatPatternsMap

        java.util.Map<java.lang.String,​java.lang.String> getFormatPatternsMap()
        This export configuration setting should be used when converting java format patterns to equivalent proprietary format patterns. It should be constructed as a Map containing java format patterns as keys and the correspondent proprietary format pattern as correspondent value

        See Also:
        HSSFDataFormat
      • isIgnoreAnchors

        java.lang.Boolean isIgnoreAnchors()
        Flag that indicates whether local anchors should be ignored when elements are exported to Excel.
        See Also:
        PROPERTY_IGNORE_ANCHORS
      • getFitWidth

        java.lang.Integer getFitWidth()
        This setting indicates the number of pages wide to fit the sheet in.
        See Also:
        PROPERTY_FIT_WIDTH
      • getFitHeight

        java.lang.Integer getFitHeight()
        This setting indicates the number of pages height to fit the sheet in.
        See Also:
        PROPERTY_FIT_WIDTH
      • getPageScale

        java.lang.Integer getPageScale()
        This setting is used to adjust the page content to a given percent of the normal size in the print preview pane. Allowed values are positive integers from 10 to 400, representing percents of the normal size. This setting overrides the getFitWidth() and getFitHeight() settings.
        See Also:
        PROPERTY_PAGE_SCALE
      • getSheetDirection

        RunDirectionEnum getSheetDirection()
        This setting indicates if the sheet is left-to-right or right-to-left oriented. Possible values are:
        • LTR - meaning left-to-right
        • RTL - meaning right-to-left
        The default value is LTR.
        See Also:
        PROPERTY_SHEET_DIRECTION
      • getColumnWidthRatio

        java.lang.Float getColumnWidthRatio()
        Setting used to adjust all column widths in a document or sheet with the same width ratio, in order to get column width values suitable for Excel output. Usually column widths are measured by Excel in Normal style default character width units, while the JR engine uses pixels as default size units. When exporting the report to the Excel output format, the pixel-to-character width translation depends on the normal style default character width provided by the Excel instance, so it cannot be always accurately fitted. In this case, one can alter the generated column widths by setting this property with a float value representing the adjustment ratio.
        See Also:
        PROPERTY_COLUMN_WIDTH_RATIO
      • isUseTimeZone

        java.lang.Boolean isUseTimeZone()
        Flag that determines whether date values are to be translated to the timezone that was used to fill the report.

        By default, date values are exported to Excel using the default timezone of the system. Setting this to true instructs the exporter to use he report fill timezone to export date values.

        This only has effect when isDetectCellType() is set.

        See Also:
        PROPERTY_USE_TIMEZONE
      • getFirstPageNumber

        java.lang.Integer getFirstPageNumber()
        Setting that specifies the first page number in the page setup dialog.
        See Also:
        PROPERTY_FIRST_PAGE_NUMBER
      • isShowGridLines

        java.lang.Boolean isShowGridLines()
        Flag that specifies if the gridlines in a given sheet are shown.
        See Also:
        PROPERTY_SHOW_GRIDLINES
      • isAutoFitPageHeight

        java.lang.Boolean isAutoFitPageHeight()
        Flag that specifies whether the fit height should be estimated automatically.
        See Also:
        PROPERTY_AUTO_FIT_PAGE_HEIGHT
      • isForcePageBreaks

        java.lang.Boolean isForcePageBreaks()
        Flag that specifies whether the page breaks to be marked automatically on each sheet.
        See Also:
        PROPERTY_FORCE_PAGE_BREAKS
      • isShrinkToFit

        java.lang.Boolean isShrinkToFit()
        Flag that indicates whether the text font size should be decreased in order to keep the entire text visible in the cell. If set to true, this will automatically disable the wrap text property (see isWrapText()).

        Usually this setting works in conjunction with net.sf.jasperreports.print.keep.full.text, in order to preserve the entire text content at export time.

        See Also:
        PROPERTY_SHRINK_TO_FIT
      • isIgnoreTextFormatting

        java.lang.Boolean isIgnoreTextFormatting()
        Flag that indicates whether the text elements should be exported without text formatting features, such as bold, italic, underline, text color, backcolor, etc.

        See Also:
        PROPERTY_IGNORE_TEXT_FORMATTING
      • getSheetTabColor

        java.awt.Color getSheetTabColor()
        This setting is used to set the tab color of the sheets. Global and report-level settings are overridden by element-level settings for this property. If several elements in a sheet contain this property, the engine will consider the value of the last exported element's property.

        The setting is neglected in XLS export channel (works with XLSX and ODS only)

        See Also:
        PROPERTY_SHEET_TAB_COLOR
      • getFreezeRow

        java.lang.Integer getFreezeRow()
        Specifies the index of the first unlocked row in document's sheets. All rows above this will be 'frozen'. Allowed values are represented by positive integers in the 1..65536 range. Negative values are not considered.
        See Also:
        PROPERTY_FREEZE_ROW
      • getFreezeColumn

        java.lang.String getFreezeColumn()
        Indicates the name of the first unlocked column in document's sheets. All columns to the left of this one will be 'frozen'. Allowed values are letters or letter combinations representing valid column names in Excel, such as A, B, AB, AC, etc.
        See Also:
        PROPERTY_FREEZE_COLUMN
      • getPrintPageTopMargin

        java.lang.Integer getPrintPageTopMargin()
        Specifies the page top margin in print preview pane, measured in pixels. Default value is 0.
      • getPrintPageLeftMargin

        java.lang.Integer getPrintPageLeftMargin()
        Specifies the page left margin in print preview pane, measured in pixels. Default value is 0.
      • getPrintPageBottomMargin

        java.lang.Integer getPrintPageBottomMargin()
        Specifies the page bottom margin in print preview pane, measured in pixels. Default value is 0.
      • getPrintPageRightMargin

        java.lang.Integer getPrintPageRightMargin()
        Specifies the page right margin in print preview pane, measured in pixels. Default value is 0.
      • getPrintPageHeight

        java.lang.Integer getPrintPageHeight()
        Specifies the page height in print preview pane, measured in pixels.
      • getPrintPageWidth

        java.lang.Integer getPrintPageWidth()
        Specifies the page width in print preview pane, measured in pixels.
      • getPrintHeaderMargin

        java.lang.Integer getPrintHeaderMargin()
        Specifies the sheet header margin in print preview pane, measured in pixels. Default value is 0.
      • getPrintFooterMargin

        java.lang.Integer getPrintFooterMargin()
        Specifies the sheet footer margin in print preview pane, measured in pixels. Default value is 0.