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;
029:
030: /**
031: * An abstract representation of a Jasper report. This interface is inherited by all report implementations
032: * (designs, compiled reports, filled reports). It only contains constants and getters and setters for the most common
033: * report properties and elements.
034: * @author Teodor Danciu (teodord@users.sourceforge.net)
035: * @version $Id: JRReport.java 1797 2007-07-30 09:38:35Z teodord $
036: */
037: public interface JRReport extends JRDefaultFontProvider,
038: JRDefaultStyleProvider, JRPropertiesHolder {
039:
040: /**
041: * A constant used to specify that the language used by expressions is Java.
042: */
043: public static final String LANGUAGE_JAVA = "java";
044:
045: /**
046: * A constant used to specify that the language used by expressions is Groovy.
047: */
048: public static final String LANGUAGE_GROOVY = "groovy";
049:
050: /**
051: * Specifies that columns in a report should be filled vertically (fill an entire column and then go to the
052: * next one).
053: */
054: public static final byte PRINT_ORDER_VERTICAL = 1;
055:
056: /**
057: * Specifies that columns in a report should be filled horizontalyy (columns are filled proportionally).
058: */
059: public static final byte PRINT_ORDER_HORIZONTAL = 2;
060:
061: /**
062: * Specifies a portrait orientation. This is used mostly to inform printers of page layouts.
063: */
064: public static final byte ORIENTATION_PORTRAIT = 1;
065:
066: /**
067: * Specifies a landscape orientation. This is used mostly to inform printers of page layouts.
068: */
069: public static final byte ORIENTATION_LANDSCAPE = 2;
070:
071: /**
072: * Specifies that in case of empty datasources, there will be an empty report.
073: */
074: public static final byte WHEN_NO_DATA_TYPE_NO_PAGES = 1;
075:
076: /**
077: * Specifies that in case of empty datasources, there will be a report with just one blank page.
078: */
079: public static final byte WHEN_NO_DATA_TYPE_BLANK_PAGE = 2;
080:
081: /**
082: * Specifies that in case of empty datasources, all sections except detail will displayed.
083: */
084: public static final byte WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL = 3;
085:
086: /**
087: * Specifies that in case of empty datasources, the NoData section will be displayed.
088: */
089: public static final byte WHEN_NO_DATA_TYPE_NO_DATA_SECTION = 4;
090:
091: /**
092: * Return NULL when a resource is missing.
093: */
094: public static final byte WHEN_RESOURCE_MISSING_TYPE_NULL = JRDataset.WHEN_RESOURCE_MISSING_TYPE_NULL;
095:
096: /**
097: * Return empty string when a resource is missing.
098: */
099: public static final byte WHEN_RESOURCE_MISSING_TYPE_EMPTY = JRDataset.WHEN_RESOURCE_MISSING_TYPE_EMPTY;
100:
101: /**
102: * Return the key when a resource is missing.
103: */
104: public static final byte WHEN_RESOURCE_MISSING_TYPE_KEY = JRDataset.WHEN_RESOURCE_MISSING_TYPE_KEY;
105:
106: /**
107: * Throw an exception when a resource is missing.
108: */
109: public static final byte WHEN_RESOURCE_MISSING_TYPE_ERROR = JRDataset.WHEN_RESOURCE_MISSING_TYPE_ERROR;
110:
111: /**
112: * Gets the report name.
113: */
114: public String getName();
115:
116: /**
117: * Gets the report language. Should be Java or Groovy.
118: */
119: public String getLanguage();
120:
121: /**
122: * Gets the number of columns on each page
123: */
124: public int getColumnCount();
125:
126: /**
127: * Specifies whether columns will be filled horizontally or vertically.
128: * @see JRReport PRINT_ORDER_VERTICAL,
129: * @see JRReport PRINT_ORDER_HORIZONTAL
130: */
131: public byte getPrintOrder();
132:
133: /**
134: *
135: */
136: public int getPageWidth();
137:
138: /**
139: *
140: */
141: public int getPageHeight();
142:
143: /**
144: *
145: */
146: public byte getOrientation();
147:
148: /**
149: * Specifies the report behaviour in case of empty datasources.
150: */
151: public byte getWhenNoDataType();
152:
153: /**
154: * Sets the report behaviour in case of empty datasources.
155: */
156: public void setWhenNoDataType(byte whenNoDataType);
157:
158: /**
159: *
160: */
161: public int getColumnWidth();
162:
163: /**
164: * Specifies the space between columns on the same page.
165: */
166: public int getColumnSpacing();
167:
168: /**
169: *
170: */
171: public int getLeftMargin();
172:
173: /**
174: *
175: */
176: public int getRightMargin();
177:
178: /**
179: *
180: */
181: public int getTopMargin();
182:
183: /**
184: *
185: */
186: public int getBottomMargin();
187:
188: /**
189: * Specifies if the title section will be printed on a separate initial page.
190: */
191: public boolean isTitleNewPage();
192:
193: /**
194: * Specifies if the summary section will be printed on a separate last page.
195: */
196: public boolean isSummaryNewPage();
197:
198: /**
199: * Specifie if the column footer section will be printed at the bottom of the column or if it
200: * will immediately follow the last detail or group footer printed on the current column.
201:
202: */
203: public boolean isFloatColumnFooter();
204:
205: /**
206: *
207: */
208: public String getScriptletClass();
209:
210: /**
211: * Gets the name of the class implementing the {@link net.sf.jasperreports.engine.util.FormatFactory FormatFactory}
212: * interface to use with this report.
213: */
214: public String getFormatFactoryClass();
215:
216: /**
217: * Gets the base name of the report associated resource bundle.
218: */
219: public String getResourceBundle();
220:
221: /**
222: * Gets an array of report properties names.
223: */
224: public String[] getPropertyNames();
225:
226: /**
227: * Gets a property value
228: * @param name the property name
229: */
230: public String getProperty(String name);
231:
232: /**
233: *
234: */
235: public void setProperty(String name, String value);
236:
237: /**
238: *
239: */
240: public void removeProperty(String name);
241:
242: /**
243: * Gets an array of imports (needed if report expression require additional classes in order to compile).
244: */
245: public String[] getImports();
246:
247: /**
248: * Gets an array of report fonts.
249: */
250: public JRReportFont[] getFonts();
251:
252: /**
253: * Gets an array of report styles.
254: */
255: public JRStyle[] getStyles();
256:
257: /**
258: *
259: */
260: public JRParameter[] getParameters();
261:
262: /**
263: *
264: */
265: public JRQuery getQuery();
266:
267: /**
268: *
269: */
270: public JRField[] getFields();
271:
272: /**
273: *
274: */
275: public JRSortField[] getSortFields();
276:
277: /**
278: *
279: */
280: public JRVariable[] getVariables();
281:
282: /**
283: *
284: */
285: public JRGroup[] getGroups();
286:
287: /**
288: *
289: */
290: public JRBand getBackground();
291:
292: /**
293: *
294: */
295: public JRBand getTitle();
296:
297: /**
298: *
299: */
300: public JRBand getPageHeader();
301:
302: /**
303: *
304: */
305: public JRBand getColumnHeader();
306:
307: /**
308: *
309: */
310: public JRBand getDetail();
311:
312: /**
313: *
314: */
315: public JRBand getColumnFooter();
316:
317: /**
318: *
319: */
320: public JRBand getPageFooter();
321:
322: /**
323: *
324: */
325: public JRBand getLastPageFooter();
326:
327: /**
328: *
329: */
330: public JRBand getSummary();
331:
332: /**
333: *
334: */
335: public JRBand getNoData();
336:
337: /**
338: * Returns the resource missing handling type.
339: */
340: public byte getWhenResourceMissingType();
341:
342: /**
343: * Sets the resource missing handling type.
344: * @param whenResourceMissingType the resource missing handling type
345: */
346: public void setWhenResourceMissingType(byte whenResourceMissingType);
347:
348: /**
349: * Returns the main report dataset.
350: * <p>
351: * The main report dataset consists of all parameters, fields, variables and groups of the report.
352: *
353: * @return the main report dataset
354: */
355: public JRDataset getMainDataset();
356:
357: /**
358: * Returns the datasets of this report.
359: *
360: * @return the datasets of this report
361: */
362: public JRDataset[] getDatasets();
363:
364: /**
365: * Decides whether to use pagination when filling the report.
366: * <p>
367: * If set to <code>true</code> the report will be generated on one long page.
368: * <p>
369: * The design attribute can be overridden at fill time by the {@link JRParameter#IS_IGNORE_PAGINATION IS_IGNORE_PAGINATION}
370: * parameter.
371: *
372: * @return whether to use pagination when filling the report
373: */
374: public boolean isIgnorePagination();
375:
376: /**
377: * Returns the list of report templates.
378: * <p/>
379: * A report template is an expression which resolves at runtime to a {@link JRTemplate template}.
380: * Templates include styles which can be used in the report.
381: * <p/>
382: * The order in which the templates are included in the report is important:
383: * <ul>
384: * <li>A style's parent must appear before the style itself.</li>
385: * <li>A style overrides styles with the same name that are placed before it.
386: * Also, report styles override templates styles with the same name.</li>
387: * </ul>
388: *
389: * @return the list of report templates, or <code>null</code> if none
390: * @see JRTemplate
391: * @see JRParameter#REPORT_TEMPLATES
392: */
393: public JRReportTemplate[] getTemplates();
394:
395: }
|