001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.engine.export;
029:
030: import net.sf.jasperreports.engine.JRExporterParameter;
031: import net.sf.jasperreports.engine.JRPrintFrame;
032: import net.sf.jasperreports.engine.util.JRProperties;
033:
034: /**
035: * Contains parameters useful for export in HTML format.
036: * <p>
037: * The HTML exporter can send data to a string buffer, output stream, character stream or file on disk. The engine looks
038: * among the export parameters in order to find the selected output type in this order: OUTPUT_STRING_BUFFER, OUTPUT_WRITER,
039: * OUTPUT_STREAM, OUTPUT_FILE, OUTPUT_FILE_NAME.
040: * <p>
041: * An important issue is images. The HTML format stores images as separate files, so the exporter needs to know
042: * where these images will be stored. If they are stored on disk, the IMAGES_URI parameter will be initialized with a string
043: * containing the file name on disk. If they remain in memory, IMAGES_URI must point to a resource that is able to send the images
044: * to the browser (such as an image servlet, as shown in the <i>webapp</i> example).
045: *
046: * @author Teodor Danciu (teodord@users.sourceforge.net)
047: * @version $Id: JRHtmlExporterParameter.java 1824 2007-08-23 14:19:12Z teodord $
048: */
049: public class JRHtmlExporterParameter extends JRExporterParameter {
050:
051: /**
052: *
053: */
054: protected JRHtmlExporterParameter(String name) {
055: super (name);
056: }
057:
058: /**
059: * A map containing all the images that were used for generating the report. The JasperReports engine stores all the
060: * images in this map, and uses the map keys for referencing images throughout the export process.
061: */
062: public static final JRHtmlExporterParameter IMAGES_MAP = new JRHtmlExporterParameter(
063: "Images Map Object");
064:
065: /**
066: * A <tt>java.io.File</tt> instance representing an absolute path to a folder on a local disk, where all the images are stored.
067: */
068: public static final JRHtmlExporterParameter IMAGES_DIR = new JRHtmlExporterParameter(
069: "Images Directory");
070:
071: /**
072: * An absolute path to a folder on a local disk, where all the images are stored. This is an alternative to IMAGES_DIR
073: */
074: public static final JRHtmlExporterParameter IMAGES_DIR_NAME = new JRHtmlExporterParameter(
075: "Images Directory Name");
076:
077: /**
078: * A boolean value specifying whether the images should be stored on disk. The default value is true. If this parameter is
079: * specified, IMAGES_DIR or IMAGES_DIR_NAME must also be specified and point to a valid directory.
080: */
081: public static final JRHtmlExporterParameter IS_OUTPUT_IMAGES_TO_DIR = new JRHtmlExporterParameter(
082: "Is Output Images to Directory Flag");
083:
084: /**
085: * An URI to the folder where all the images are stored. It could also point to a different resource, such as an image servlet.
086: * It is used in the generated HTML to point to the actual location of the image in the <img> tag (as a file on disk or a
087: * web resource).
088: */
089: public static final JRHtmlExporterParameter IMAGES_URI = new JRHtmlExporterParameter(
090: "Images URI");
091:
092: /**
093: * A string representing HTML code that will be inserted in front of the generated report. The JasperReports engine places
094: * a piece of HTML code at the top of the page but users can define their own headers and stylesheet links.
095: */
096: public static final JRHtmlExporterParameter HTML_HEADER = new JRHtmlExporterParameter(
097: "HTML Header");
098:
099: /**
100: * A string representing HTML code that will be inserted between pages of the generated report. By default, JasperReports
101: * separates pages by two empty lines, but this behaviour can be overriden by this parameter.
102: */
103: public static final JRHtmlExporterParameter BETWEEN_PAGES_HTML = new JRHtmlExporterParameter(
104: "Between Pages HTML");
105:
106: /**
107: * A string representing HTML code that will be inserted after the generated report. By default, JasperReports closes
108: * the usual HTML tags that were opened in HTML_HEADER. If the default HTML_HEADER was overriden, it is recommended that
109: * this parameter is overriden too, in order to ensure proper construction of HTML page.
110: */
111: public static final JRHtmlExporterParameter HTML_FOOTER = new JRHtmlExporterParameter(
112: "HTML Footer");
113:
114: /**
115: * A boolean value specifying whether the blank lines, that sometimes appear between rows, should be deleted. Sometimes page
116: * break occurs before the entire page is filled with data (i.e. having a group with the <i>isStartNewPage</i> attribute set to true).
117: * All the remaining empty space could be removed by setting this parameter to true.
118: */
119: public static final JRHtmlExporterParameter IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS = new JRHtmlExporterParameter(
120: "Is Remove Empty Space Between Rows");
121:
122: /**
123: * 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.
124: * <p/>
125: * This property is by default not set (<code>false</code>).
126: *
127: * @see JRProperties
128: */
129: public static final String PROPERTY_REMOVE_EMPTY_SPACE_BETWEEN_ROWS = JRProperties.PROPERTY_PREFIX
130: + "export.html.remove.emtpy.space.between.rows";
131:
132: /**
133: * A boolean value specifying whether the report background should be white. If this parameter is not set, the default
134: * background will appear, depending on the selected CSS styles.
135: */
136: public static final JRHtmlExporterParameter IS_WHITE_PAGE_BACKGROUND = new JRHtmlExporterParameter(
137: "Is White Page Background");
138:
139: /**
140: * Property whose value is used as default state of the {@link #IS_WHITE_PAGE_BACKGROUND IS_WHITE_PAGE_BACKGROUND} export flag.
141: * <p/>
142: * This property is set by default (<code>true</code>).
143: *
144: * @see JRProperties
145: */
146: public static final String PROPERTY_WHITE_PAGE_BACKGROUND = JRProperties.PROPERTY_PREFIX
147: + "export.xls.white.page.background";
148:
149: /**
150: * A boolean value specifying whether the export engine should use small images for aligning. This is useful when you don't have
151: * images in your report anyway and you don't want to have to handle images at all.
152: */
153: public static final JRHtmlExporterParameter IS_USING_IMAGES_TO_ALIGN = new JRHtmlExporterParameter(
154: "Is Using Images To Align");
155:
156: /**
157: * Property whose value is used as default state of the {@link #IS_USING_IMAGES_TO_ALIGN IS_USING_IMAGES_TO_ALIGN} export flag.
158: * <p/>
159: * This property is set by default (<code>true</code>).
160: *
161: * @see JRProperties
162: */
163: public static final String PROPERTY_USING_IMAGES_TO_ALIGN = JRProperties.PROPERTY_PREFIX
164: + "export.html.using.images.to.align";
165:
166: /**
167: * A boolean value specifying whether the export engine should use force wrapping by breaking words (CSS <code>word-wrap: break-word</code>).
168: */
169: public static final JRHtmlExporterParameter IS_WRAP_BREAK_WORD = new JRHtmlExporterParameter(
170: "Is Wrap Break Word");
171:
172: /**
173: * Property whose value is used as default state of the {@link #IS_WRAP_BREAK_WORD IS_WRAP_BREAK_WORD} export flag.
174: * <p/>
175: * This property is by default not set (<code>false</code>).
176: *
177: * @see JRProperties
178: */
179: public static final String PROPERTY_WRAP_BREAK_WORD = JRProperties.PROPERTY_PREFIX
180: + "export.html.wrap.break.word";
181:
182: /**
183: * A String value specifying the unit to use when measuring lengths or font size.
184: * This can be one of the supported size units from the CSS specifications like "px" for pixels
185: * or "pt" for points. The default value is "px", meaning that lengths and font sizes are specified in pixels.
186: */
187: public static final JRHtmlExporterParameter SIZE_UNIT = new JRHtmlExporterParameter(
188: "Size Unit");
189:
190: /**
191: * Property whose value is used as default for the {@link #SIZE_UNIT SIZE_UNIT} export parameter.
192: *
193: * @see JRProperties
194: */
195: public static final String PROPERTY_SIZE_UNIT = JRProperties.PROPERTY_PREFIX
196: + "export.html.size.unit";
197:
198: /**
199: * Possible value for the {@link JRHtmlExporterParameter#SIZE_UNIT} parameter indicated that measurements are made in pixels.
200: */
201: public static final String SIZE_UNIT_PIXEL = "px";
202:
203: /**
204: * Possible value for the {@link JRHtmlExporterParameter#SIZE_UNIT} parameter indicated that measurements are made in points.
205: */
206: public static final String SIZE_UNIT_POINT = "pt";
207:
208: /**
209: * Indicates whether {@link JRPrintFrame frames} are to be exported as nested HTML tables.
210: * <p>
211: * The type of the parameter is <code>java.lang.Boolean</code>.
212: * </p>
213: * <p>
214: * Is set to <code>false</code>, the frame contents will be integrated into the master/page HTML table.
215: * This can be useful when exporting frames as nested tables causes output misalignments.
216: * </p>
217: * @see JRHtmlExporter#PROPERTY_FRAMES_AS_NESTED_TABLES
218: */
219: public static final JRHtmlExporterParameter FRAMES_AS_NESTED_TABLES = new JRHtmlExporterParameter(
220: "Export frames as nested tables");
221:
222: /**
223: * This property serves as default value for the {@link #FRAMES_AS_NESTED_TABLES FRAMES_AS_NESTED_TABLES}
224: * export parameter.
225: * <p>
226: * The propery itself defaults to <code>true</code>.
227: * </p>
228: * @see JRProperties
229: */
230: public static final String PROPERTY_FRAMES_AS_NESTED_TABLES = JRProperties.PROPERTY_PREFIX
231: + "export.html.frames.as.nested.tables";
232:
233: }
|