2
* JasperReports - Free Java Reporting Library.
3
* Copyright (C) 2001 - 2009 Jaspersoft Corporation. All rights reserved.
4
* http://www.jaspersoft.com
6
* Unless you have purchased a commercial license agreement from Jaspersoft,
7
* the following license terms apply:
9
* This program is part of JasperReports.
11
* JasperReports is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License as published by
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
16
* JasperReports is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Lesser General Public License for more details.
21
* You should have received a copy of the GNU Lesser General Public License
22
* along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
24
package net.sf.jasperreports.engine.export;
26
import net.sf.jasperreports.engine.JRExporterParameter;
27
import net.sf.jasperreports.engine.util.JRProperties;
31
* Contains parameters useful for export in XLS format.
33
* The XLS exporter can send data to an output stream or file on disk. The engine looks among the export parameters in
34
* order to find the selected output type in this order: OUTPUT_STREAM, OUTPUT_FILE, OUTPUT_FILE_NAME.
36
* @author Sanda Zaharia (shertage@users.sourceforge.net)
37
* @version $Id: JRXlsAbstractExporterParameter.java 3783 2010-05-11 08:20:22Z shertage $
39
public class JRXlsAbstractExporterParameter extends JRExporterParameter
46
protected JRXlsAbstractExporterParameter(String name)
53
* A boolean value specifying whether each report page should be written in a different XLS sheet
55
public static final JRXlsAbstractExporterParameter IS_ONE_PAGE_PER_SHEET = new JRXlsAbstractExporterParameter("Is One Page per Sheet");
59
* Property whose value is used as default state of the {@link #IS_ONE_PAGE_PER_SHEET IS_ONE_PAGE_PER_SHEET} export flag.
61
* This property is by default not set (<code>false</code>).
65
public static final String PROPERTY_ONE_PAGE_PER_SHEET = JRProperties.PROPERTY_PREFIX + "export.xls.one.page.per.sheet";
69
* A boolean value specifying whether the empty spaces that could appear between rows should be removed or not.
71
public static final JRXlsAbstractExporterParameter IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS = new JRXlsAbstractExporterParameter("Is Remove Empty Space Between Rows");
75
* Property whose value is used as default state of the {@link #IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS} export flag.
77
* This property is by default not set (<code>false</code>).
81
public static final String PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS = JRProperties.PROPERTY_PREFIX + "export.xls.remove.empty.space.between.rows";
85
* A boolean value specifying whether the empty spaces that could appear between columns should be removed or not.
87
public static final JRXlsAbstractExporterParameter IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS = new JRXlsAbstractExporterParameter("Is Remove Empty Space Between Columns");
91
* Property whose value is used as default state of the {@link #IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS} export flag.
93
* This property is by default not set (<code>false</code>).
97
public static final String PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS = JRProperties.PROPERTY_PREFIX + "export.xls.remove.empty.space.between.columns";
101
* A boolean value specifying whether the page background should be white or the default XLS background color. This background
102
* may vary depending on the XLS viewer properties or the operating system color scheme.
104
public static final JRXlsAbstractExporterParameter IS_WHITE_PAGE_BACKGROUND = new JRXlsAbstractExporterParameter("Is White Page Background");
108
* Property whose value is used as default state of the {@link #IS_WHITE_PAGE_BACKGROUND IS_WHITE_PAGE_BACKGROUND} export flag.
110
* This property is set by default (<code>true</code>).
114
public static final String PROPERTY_WHITE_PAGE_BACKGROUND = JRProperties.PROPERTY_PREFIX + "export.xls.white.page.background";
118
* A boolean value specifying whether the exporter should try to automatically detect cell types based on the cell value.
120
* @deprecated The {@link #IS_DETECT_CELL_TYPE IS_DETECT_CELL_TYPE} offers more consistent numerical cell detection.
122
public static final JRXlsAbstractExporterParameter IS_AUTO_DETECT_CELL_TYPE = new JRXlsAbstractExporterParameter("Is Auto Detect Cell Type");
126
* Flag used to indicate whether the exporter should take into consideration the type of the
127
* original text field expressions and set the cell types and values accordingly.
129
* Text fields having numerical or date expressions save type and formatting (format pattern, locale and time zone)
130
* information in the {@link net.sf.jasperreports.engine.JasperPrint JasperPrint}/{@link net.sf.jasperreports.engine.JRPrintText JRPrintText}
131
* object created by the report fill process.
134
* When this flag is set, the exporter will parse back the <code>String</code> value of numerical/date texts.
135
* Numerical/date cells will be created and the original pattern of the text will be included
136
* as part of the cell style.
139
* Note that this mechanism would not work when the text field overflows and splits on two pages/columns.
140
* Also, it is required that the text field expression has a numerical or date type set.
143
* This flag is off by default to ensure backwards compatibility.
146
public static final JRXlsAbstractExporterParameter IS_DETECT_CELL_TYPE = new JRXlsAbstractExporterParameter("Is Detect Cell Type");
150
* Property whose value is used as default state of the {@link #IS_DETECT_CELL_TYPE IS_DETECT_CELL_TYPE} export flag.
152
* This property is by default not set (<code>false</code>).
156
public static final String PROPERTY_DETECT_CELL_TYPE = JRProperties.PROPERTY_PREFIX + "export.xls.detect.cell.type";
160
* An array of strings representing custom sheet names. This is useful when used with the <i>IS_ONE_PAGE_PER_SHEET</i>
163
public static final JRXlsAbstractExporterParameter SHEET_NAMES = new JRXlsAbstractExporterParameter("Sheet Names");
167
* Property prefix used in order to identify a set of properties holding sheet names, very useful when
168
* indicating sheet names in the jrxml template is required. These properties' values are collected in an
169
* ordered list, therefore it is important the order they are written in. If set, these values are considered
170
* as defaults for the {@link #SHEET_NAMES} export parameter.
172
* A property starting with this prefix can hold one or many sheet names. In order to be well parsed,
173
* sheet names contained in such a property's value should be separated by a slash character ("/")
175
* These properties are by default not set.
179
public static final String PROPERTY_SHEET_NAMES_PREFIX = JRProperties.PROPERTY_PREFIX + "export.xls.sheet.names.";
183
* Flag for decreasing font size so that texts fit into the specified cell height.
185
public static final JRXlsAbstractExporterParameter IS_FONT_SIZE_FIX_ENABLED = new JRXlsAbstractExporterParameter("Is Font Size Fix Enabled");
189
* Flag for forcing the minimum image padding to 1 pixel, to avoid situations where the image hides the cell border.
191
public static final JRXlsAbstractExporterParameter IS_IMAGE_BORDER_FIX_ENABLED = new JRXlsAbstractExporterParameter("Is Image Border Fix Enabled");
195
* Property whose value is used as default state of the {@link #IS_FONT_SIZE_FIX_ENABLED IS_FONT_SIZE_FIX_ENABLED} export flag.
197
* This property is by default not set (<code>false</code>).
201
public static final String PROPERTY_FONT_SIZE_FIX_ENABLED = JRProperties.PROPERTY_PREFIX + "export.xls.font.size.fix.enabled";
205
* Property whose value is used as default state of the {@link #IS_IMAGE_BORDER_FIX_ENABLED IS_IMAGE_BORDER_FIX_ENABLED} export flag.
207
* This property is by default not set (<code>false</code>).
211
public static final String PROPERTY_IMAGE_BORDER_FIX_ENABLED = JRProperties.PROPERTY_PREFIX + "export.xls.image.border.fix.enabled";
215
* This export parameter should be used when converting java format patterns to equivalent proprietary
216
* format patterns. It should be constructed as a Map containing java format patterns as keys and the
217
* correspondent proprietary format pattern as correspondent value
219
* @see org.apache.poi.hssf.usermodel.HSSFDataFormat
220
* @see jxl.write.NumberFormat
222
public static final JRExporterParameter FORMAT_PATTERNS_MAP = new JRXlsExporterParameter("Format Patterns Map");
226
* An integer value specifying the maximum number of rows allowed to be shown in a sheet.
227
* 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.
229
public static final JRExporterParameter MAXIMUM_ROWS_PER_SHEET = new JRXlsExporterParameter("Maximum Rows Per Sheet");
233
* Property whose value is used as default of the {@link #MAXIMUM_ROWS_PER_SHEET MAXIMUM_ROWS_PER_SHEET} export parameter.
235
* This property is by default to zero.
239
public static final String PROPERTY_MAXIMUM_ROWS_PER_SHEET = JRProperties.PROPERTY_PREFIX + "export.xls.max.rows.per.sheet";
243
* Flag for ignoring graphic elements and exporting text elements only.
245
public static final JRXlsAbstractExporterParameter IS_IGNORE_GRAPHICS = new JRXlsAbstractExporterParameter("Is Ignore Graphics");
249
* Property whose value is used as default state of the {@link #IS_IGNORE_GRAPHICS IS_IGNORE_GRAPHICS} export flag.
251
* This property is by default not set (<code>false</code>).
255
public static final String PROPERTY_IGNORE_GRAPHICS = JRProperties.PROPERTY_PREFIX + "export.xls.ignore.graphics";
259
* Flag for collapsing row span and avoid merging cells across rows.
261
public static final JRXlsAbstractExporterParameter IS_COLLAPSE_ROW_SPAN = new JRXlsAbstractExporterParameter("Is Collapse Row Span");
265
* Property whose value is used as default state of the {@link #IS_COLLAPSE_ROW_SPAN IS_COLLAPSE_ROW_SPAN} export flag.
267
* This property is by default not set (<code>false</code>).
271
public static final String PROPERTY_COLLAPSE_ROW_SPAN = JRProperties.PROPERTY_PREFIX + "export.xls.collapse.row.span";
275
* Flag for ignoring the cell border.
277
public static final JRXlsAbstractExporterParameter IS_IGNORE_CELL_BORDER = new JRXlsAbstractExporterParameter("Is Ignore Cell Border");
281
* Property whose value is used as default state of the {@link #IS_IGNORE_CELL_BORDER IS_IGNORE_CELL_BORDER} export flag.
283
* This property is by default not set (<code>false</code>).
287
public static final String PROPERTY_IGNORE_CELL_BORDER = JRProperties.PROPERTY_PREFIX + "export.xls.ignore.cell.border";
291
* Flag for ignoring the cell background color.
293
public static final JRXlsAbstractExporterParameter IS_IGNORE_CELL_BACKGROUND = new JRXlsAbstractExporterParameter("Is Ignore Cell Background");
297
* Property whose value is used as default state of the {@link #IS_IGNORE_CELL_BACKGROUND IS_IGNORE_CELL_BACKGROUND} export flag.
299
* This property is by default not set (<code>false</code>).
303
public static final String PROPERTY_IGNORE_CELL_BACKGROUND = JRProperties.PROPERTY_PREFIX + "export.xls.ignore.cell.background";
307
* A String value representing the password in case of password protected documents
309
public static final JRXlsAbstractExporterParameter PASSWORD = new JRXlsAbstractExporterParameter("Password");
313
* Property whose value is used as default value of the {@link #PASSWORD PASSWORD} export parameter.
315
* This property is by default not set (<code>null</code>).
319
public static final String PROPERTY_PASSWORD = JRProperties.PROPERTY_PREFIX + "export.xls.password";
322
* This property indicates whether text wrapping is allowed in a given cell.
324
* The property itself defaults to <code>true</code>.
328
public static final String PROPERTY_WRAP_TEXT = JRProperties.PROPERTY_PREFIX + "export.xls.wrap.text";