~brian-thomason/+junk/jasperreports3.7

« back to all changes in this revision

Viewing changes to src/net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.java

  • Committer: Brian Thomason
  • Date: 2011-12-20 17:51:16 UTC
  • Revision ID: brian.thomason@canonical.com-20111220175116-apwo6unuaedvgzo3
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * JasperReports - Free Java Reporting Library.
 
3
 * Copyright (C) 2001 - 2009 Jaspersoft Corporation. All rights reserved.
 
4
 * http://www.jaspersoft.com
 
5
 *
 
6
 * Unless you have purchased a commercial license agreement from Jaspersoft,
 
7
 * the following license terms apply:
 
8
 *
 
9
 * This program is part of JasperReports.
 
10
 *
 
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.
 
15
 *
 
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.
 
20
 * 
 
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/>.
 
23
 */
 
24
package net.sf.jasperreports.engine.export;
 
25
 
 
26
import net.sf.jasperreports.engine.JRExporterParameter;
 
27
import net.sf.jasperreports.engine.util.JRProperties;
 
28
 
 
29
 
 
30
/**
 
31
 * Contains parameters useful for export in XLS format.
 
32
 * <p>
 
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.
 
35
 *
 
36
 * @author Sanda Zaharia (shertage@users.sourceforge.net)
 
37
 * @version $Id: JRXlsAbstractExporterParameter.java 3783 2010-05-11 08:20:22Z shertage $
 
38
 */
 
39
public class JRXlsAbstractExporterParameter extends JRExporterParameter
 
40
{
 
41
 
 
42
 
 
43
        /**
 
44
         *
 
45
         */
 
46
        protected JRXlsAbstractExporterParameter(String name)
 
47
        {
 
48
                super(name);
 
49
        }
 
50
 
 
51
 
 
52
        /**
 
53
         * A boolean value specifying whether each report page should be written in a different XLS sheet
 
54
         */
 
55
        public static final JRXlsAbstractExporterParameter IS_ONE_PAGE_PER_SHEET = new JRXlsAbstractExporterParameter("Is One Page per Sheet");
 
56
 
 
57
 
 
58
        /**
 
59
         * Property whose value is used as default state of the {@link #IS_ONE_PAGE_PER_SHEET IS_ONE_PAGE_PER_SHEET} export flag.
 
60
         * <p/>
 
61
         * This property is by default not set (<code>false</code>).
 
62
         * 
 
63
         * @see JRProperties
 
64
         */
 
65
        public static final String PROPERTY_ONE_PAGE_PER_SHEET = JRProperties.PROPERTY_PREFIX + "export.xls.one.page.per.sheet";
 
66
 
 
67
 
 
68
        /**
 
69
         * A boolean value specifying whether the empty spaces that could appear between rows should be removed or not.
 
70
         */
 
71
        public static final JRXlsAbstractExporterParameter IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS = new JRXlsAbstractExporterParameter("Is Remove Empty Space Between Rows");
 
72
 
 
73
 
 
74
        /**
 
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.
 
76
         * <p/>
 
77
         * This property is by default not set (<code>false</code>).
 
78
         * 
 
79
         * @see JRProperties
 
80
         */
 
81
        public static final String PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS = JRProperties.PROPERTY_PREFIX + "export.xls.remove.empty.space.between.rows";
 
82
 
 
83
 
 
84
        /**
 
85
         * A boolean value specifying whether the empty spaces that could appear between columns should be removed or not.
 
86
         */
 
87
        public static final JRXlsAbstractExporterParameter IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS = new JRXlsAbstractExporterParameter("Is Remove Empty Space Between Columns");
 
88
 
 
89
 
 
90
        /**
 
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.
 
92
         * <p/>
 
93
         * This property is by default not set (<code>false</code>).
 
94
         * 
 
95
         * @see JRProperties
 
96
         */
 
97
        public static final String PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS = JRProperties.PROPERTY_PREFIX + "export.xls.remove.empty.space.between.columns";
 
98
 
 
99
 
 
100
        /**
 
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.
 
103
         */
 
104
        public static final JRXlsAbstractExporterParameter IS_WHITE_PAGE_BACKGROUND = new JRXlsAbstractExporterParameter("Is White Page Background");
 
105
 
 
106
 
 
107
        /**
 
108
         * Property whose value is used as default state of the {@link #IS_WHITE_PAGE_BACKGROUND IS_WHITE_PAGE_BACKGROUND} export flag.
 
109
         * <p/>
 
110
         * This property is set by default (<code>true</code>).
 
111
         * 
 
112
         * @see JRProperties
 
113
         */
 
114
        public static final String PROPERTY_WHITE_PAGE_BACKGROUND = JRProperties.PROPERTY_PREFIX + "export.xls.white.page.background";
 
115
 
 
116
 
 
117
        /**
 
118
         * A boolean value specifying whether the exporter should try to automatically detect cell types based on the cell value.
 
119
         *
 
120
         * @deprecated The {@link #IS_DETECT_CELL_TYPE IS_DETECT_CELL_TYPE} offers more consistent numerical cell detection.
 
121
         */
 
122
        public static final JRXlsAbstractExporterParameter IS_AUTO_DETECT_CELL_TYPE = new JRXlsAbstractExporterParameter("Is Auto Detect Cell Type");
 
123
 
 
124
 
 
125
        /**
 
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.
 
128
         * <p>
 
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.
 
132
         * </p>
 
133
         * <p>
 
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.
 
137
         * </p>
 
138
         * <p>
 
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.
 
141
         * </p>
 
142
         * <p>
 
143
         * This flag is off by default to ensure backwards compatibility.
 
144
         * </p>
 
145
         */
 
146
        public static final JRXlsAbstractExporterParameter IS_DETECT_CELL_TYPE = new JRXlsAbstractExporterParameter("Is Detect Cell Type");
 
147
 
 
148
 
 
149
        /**
 
150
         * Property whose value is used as default state of the {@link #IS_DETECT_CELL_TYPE IS_DETECT_CELL_TYPE} export flag.
 
151
         * <p/>
 
152
         * This property is by default not set (<code>false</code>).
 
153
         * 
 
154
         * @see JRProperties
 
155
         */
 
156
        public static final String PROPERTY_DETECT_CELL_TYPE = JRProperties.PROPERTY_PREFIX + "export.xls.detect.cell.type";
 
157
 
 
158
 
 
159
        /**
 
160
         * An array of strings representing custom sheet names. This is useful when used with the <i>IS_ONE_PAGE_PER_SHEET</i>
 
161
         * parameter.
 
162
         */
 
163
        public static final JRXlsAbstractExporterParameter SHEET_NAMES = new JRXlsAbstractExporterParameter("Sheet Names");
 
164
 
 
165
 
 
166
        /**
 
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.
 
171
         * <p/>
 
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 ("/")
 
174
         * <p/>
 
175
         * These properties are by default not set.
 
176
         * 
 
177
         * @see JRProperties
 
178
         */
 
179
        public static final String PROPERTY_SHEET_NAMES_PREFIX = JRProperties.PROPERTY_PREFIX + "export.xls.sheet.names.";
 
180
 
 
181
 
 
182
        /**
 
183
         * Flag for decreasing font size so that texts fit into the specified cell height.
 
184
         */
 
185
        public static final JRXlsAbstractExporterParameter IS_FONT_SIZE_FIX_ENABLED = new JRXlsAbstractExporterParameter("Is Font Size Fix Enabled");
 
186
 
 
187
 
 
188
        /**
 
189
         * Flag for forcing the minimum image padding to 1 pixel, to avoid situations where the image hides the cell border.
 
190
         */
 
191
        public static final JRXlsAbstractExporterParameter IS_IMAGE_BORDER_FIX_ENABLED = new JRXlsAbstractExporterParameter("Is Image Border Fix Enabled");
 
192
 
 
193
 
 
194
        /**
 
195
         * Property whose value is used as default state of the {@link #IS_FONT_SIZE_FIX_ENABLED IS_FONT_SIZE_FIX_ENABLED} export flag.
 
196
         * <p/>
 
197
         * This property is by default not set (<code>false</code>).
 
198
         * 
 
199
         * @see JRProperties
 
200
         */
 
201
        public static final String PROPERTY_FONT_SIZE_FIX_ENABLED = JRProperties.PROPERTY_PREFIX + "export.xls.font.size.fix.enabled";
 
202
 
 
203
 
 
204
        /**
 
205
         * Property whose value is used as default state of the {@link #IS_IMAGE_BORDER_FIX_ENABLED IS_IMAGE_BORDER_FIX_ENABLED} export flag.
 
206
         * <p/>
 
207
         * This property is by default not set (<code>false</code>).
 
208
         * 
 
209
         * @see JRProperties
 
210
         */
 
211
        public static final String PROPERTY_IMAGE_BORDER_FIX_ENABLED = JRProperties.PROPERTY_PREFIX + "export.xls.image.border.fix.enabled";
 
212
 
 
213
 
 
214
        /**
 
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
 
218
         * <p/>
 
219
         * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
 
220
         * @see jxl.write.NumberFormat
 
221
         */
 
222
        public static final JRExporterParameter FORMAT_PATTERNS_MAP = new JRXlsExporterParameter("Format Patterns Map");
 
223
 
 
224
        
 
225
        /**
 
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.
 
228
         */
 
229
        public static final JRExporterParameter MAXIMUM_ROWS_PER_SHEET = new JRXlsExporterParameter("Maximum Rows Per Sheet");
 
230
 
 
231
        
 
232
        /**
 
233
         * Property whose value is used as default of the {@link #MAXIMUM_ROWS_PER_SHEET MAXIMUM_ROWS_PER_SHEET} export parameter.
 
234
         * <p/>
 
235
         * This property is by default to zero.
 
236
         * 
 
237
         * @see JRProperties
 
238
         */
 
239
        public static final String PROPERTY_MAXIMUM_ROWS_PER_SHEET = JRProperties.PROPERTY_PREFIX + "export.xls.max.rows.per.sheet";
 
240
 
 
241
 
 
242
        /**
 
243
         * Flag for ignoring graphic elements and exporting text elements only.
 
244
         */
 
245
        public static final JRXlsAbstractExporterParameter IS_IGNORE_GRAPHICS = new JRXlsAbstractExporterParameter("Is Ignore Graphics");
 
246
 
 
247
        
 
248
        /**
 
249
         * Property whose value is used as default state of the {@link #IS_IGNORE_GRAPHICS IS_IGNORE_GRAPHICS} export flag.
 
250
         * <p/>
 
251
         * This property is by default not set (<code>false</code>).
 
252
         * 
 
253
         * @see JRProperties
 
254
         */
 
255
        public static final String PROPERTY_IGNORE_GRAPHICS = JRProperties.PROPERTY_PREFIX + "export.xls.ignore.graphics";
 
256
 
 
257
 
 
258
        /**
 
259
         * Flag for collapsing row span and avoid merging cells across rows.
 
260
         */
 
261
        public static final JRXlsAbstractExporterParameter IS_COLLAPSE_ROW_SPAN = new JRXlsAbstractExporterParameter("Is Collapse Row Span");
 
262
 
 
263
 
 
264
        /**
 
265
         * Property whose value is used as default state of the {@link #IS_COLLAPSE_ROW_SPAN IS_COLLAPSE_ROW_SPAN} export flag.
 
266
         * <p/>
 
267
         * This property is by default not set (<code>false</code>).
 
268
         * 
 
269
         * @see JRProperties
 
270
         */
 
271
        public static final String PROPERTY_COLLAPSE_ROW_SPAN = JRProperties.PROPERTY_PREFIX + "export.xls.collapse.row.span";
 
272
 
 
273
 
 
274
        /**
 
275
         * Flag for ignoring the cell border.
 
276
         */
 
277
        public static final JRXlsAbstractExporterParameter IS_IGNORE_CELL_BORDER = new JRXlsAbstractExporterParameter("Is Ignore Cell Border");
 
278
 
 
279
 
 
280
        /**
 
281
         * Property whose value is used as default state of the {@link #IS_IGNORE_CELL_BORDER IS_IGNORE_CELL_BORDER} export flag.
 
282
         * <p/>
 
283
         * This property is by default not set (<code>false</code>).
 
284
         * 
 
285
         * @see JRProperties
 
286
         */
 
287
        public static final String PROPERTY_IGNORE_CELL_BORDER = JRProperties.PROPERTY_PREFIX + "export.xls.ignore.cell.border";
 
288
 
 
289
 
 
290
        /**
 
291
         * Flag for ignoring the cell background color.
 
292
         */
 
293
        public static final JRXlsAbstractExporterParameter IS_IGNORE_CELL_BACKGROUND = new JRXlsAbstractExporterParameter("Is Ignore Cell Background");
 
294
 
 
295
 
 
296
        /**
 
297
         * Property whose value is used as default state of the {@link #IS_IGNORE_CELL_BACKGROUND IS_IGNORE_CELL_BACKGROUND} export flag.
 
298
         * <p/>
 
299
         * This property is by default not set (<code>false</code>).
 
300
         * 
 
301
         * @see JRProperties
 
302
         */
 
303
        public static final String PROPERTY_IGNORE_CELL_BACKGROUND = JRProperties.PROPERTY_PREFIX + "export.xls.ignore.cell.background";
 
304
 
 
305
 
 
306
        /**
 
307
         * A String value representing the password in case of password protected documents 
 
308
         */
 
309
        public static final JRXlsAbstractExporterParameter PASSWORD = new JRXlsAbstractExporterParameter("Password");
 
310
 
 
311
 
 
312
        /**
 
313
         * Property whose value is used as default value of the {@link #PASSWORD PASSWORD} export parameter.
 
314
         * <p/>
 
315
         * This property is by default not set (<code>null</code>).
 
316
         * 
 
317
         * @see JRProperties
 
318
         */
 
319
        public static final String PROPERTY_PASSWORD = JRProperties.PROPERTY_PREFIX + "export.xls.password";
 
320
 
 
321
        /**
 
322
         * This property indicates whether text wrapping is allowed in a given cell.
 
323
         * <p>
 
324
         * The property itself defaults to <code>true</code>.
 
325
         * </p>
 
326
         * @see JRProperties
 
327
         */
 
328
        public static final String PROPERTY_WRAP_TEXT = JRProperties.PROPERTY_PREFIX + "export.xls.wrap.text";
 
329
 
 
330
 
 
331
}