KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > JRReport


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.engine;
29
30
31 /**
32  * An abstract representation of a Jasper report. This interface is inherited by all report implementations
33  * (designs, compiled reports, filled reports). It only contains constants and getters and setters for the most common
34  * report properties and elements.
35  * @author Teodor Danciu (teodord@users.sourceforge.net)
36  * @version $Id: JRReport.java 1485 2006-11-14 20:23:17 +0200 (Tue, 14 Nov 2006) teodord $
37  */

38 public interface JRReport extends JRDefaultFontProvider, JRDefaultStyleProvider
39 {
40
41     
42     /**
43      * A constant used to specify that the language used by expressions is Java.
44      */

45     public static final String JavaDoc LANGUAGE_JAVA = "java";
46
47     /**
48      * A constant used to specify that the language used by expressions is Groovy.
49      */

50     public static final String JavaDoc LANGUAGE_GROOVY = "groovy";
51
52     /**
53      * Specifies that columns in a report should be filled vertically (fill an entire column and then go to the
54      * next one).
55      */

56     public static final byte PRINT_ORDER_VERTICAL = 1;
57
58
59     /**
60      * Specifies that columns in a report should be filled horizontalyy (columns are filled proportionally).
61      */

62     public static final byte PRINT_ORDER_HORIZONTAL = 2;
63
64
65     /**
66      * Specifies a portrait orientation. This is used mostly to inform printers of page layouts.
67      */

68     public static final byte ORIENTATION_PORTRAIT = 1;
69
70
71     /**
72      * Specifies a landscape orientation. This is used mostly to inform printers of page layouts.
73      */

74     public static final byte ORIENTATION_LANDSCAPE = 2;
75
76     /**
77      * Specifies that in case of empty datasources, there will be an empty report.
78      */

79     public static final byte WHEN_NO_DATA_TYPE_NO_PAGES = 1;
80
81
82     /**
83      * Specifies that in case of empty datasources, there will be a report with just one blank page.
84      */

85     public static final byte WHEN_NO_DATA_TYPE_BLANK_PAGE = 2;
86
87
88     /**
89      * Specifies that in case of empty datasources, all sections except detail will displayed.
90      */

91     public static final byte WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL = 3;
92
93
94     /**
95      * Return NULL when a resource is missing.
96      */

97     public static final byte WHEN_RESOURCE_MISSING_TYPE_NULL = JRDataset.WHEN_RESOURCE_MISSING_TYPE_NULL;
98
99
100     /**
101      * Return empty string when a resource is missing.
102      */

103     public static final byte WHEN_RESOURCE_MISSING_TYPE_EMPTY = JRDataset.WHEN_RESOURCE_MISSING_TYPE_EMPTY;
104
105
106     /**
107      * Return the key when a resource is missing.
108      */

109     public static final byte WHEN_RESOURCE_MISSING_TYPE_KEY = JRDataset.WHEN_RESOURCE_MISSING_TYPE_KEY;
110
111
112     /**
113      * Throw an exception when a resource is missing.
114      */

115     public static final byte WHEN_RESOURCE_MISSING_TYPE_ERROR = JRDataset.WHEN_RESOURCE_MISSING_TYPE_ERROR;
116
117     
118     /**
119      * Gets the report name.
120      */

121     public String JavaDoc getName();
122
123     /**
124      * Gets the report language. Should be Java or Groovy.
125      */

126     public String JavaDoc getLanguage();
127         
128     /**
129      * Gets the number of columns on each page
130      */

131     public int getColumnCount();
132         
133     /**
134      * Specifies whether columns will be filled horizontally or vertically.
135      * @see JRReport PRINT_ORDER_VERTICAL,
136      * @see JRReport PRINT_ORDER_HORIZONTAL
137      */

138     public byte getPrintOrder();
139         
140     /**
141      *
142      */

143     public int getPageWidth();
144         
145     /**
146      *
147      */

148     public int getPageHeight();
149         
150     /**
151      *
152      */

153     public byte getOrientation();
154         
155     /**
156      * Specifies the report behaviour in case of empty datasources.
157      */

158     public byte getWhenNoDataType();
159         
160     /**
161      * Sets the report behaviour in case of empty datasources.
162      */

163     public void setWhenNoDataType(byte whenNoDataType);
164         
165     /**
166      *
167      */

168     public int getColumnWidth();
169         
170     /**
171      * Specifies the space between columns on the same page.
172      */

173     public int getColumnSpacing();
174         
175     /**
176      *
177      */

178     public int getLeftMargin();
179         
180     /**
181      *
182      */

183     public int getRightMargin();
184         
185     /**
186      *
187      */

188     public int getTopMargin();
189         
190     /**
191      *
192      */

193     public int getBottomMargin();
194         
195     /**
196      * Specifies if the title section will be printed on a separate initial page.
197      */

198     public boolean isTitleNewPage();
199         
200     /**
201      * Specifies if the summary section will be printed on a separate last page.
202      */

203     public boolean isSummaryNewPage();
204         
205     /**
206      * Specifie if the column footer section will be printed at the bottom of the column or if it
207      * will immediately follow the last detail or group footer printed on the current column.
208
209      */

210     public boolean isFloatColumnFooter();
211         
212     /**
213      *
214      */

215     public String JavaDoc getScriptletClass();
216
217     /**
218      * Gets the name of the class implementing the {@link net.sf.jasperreports.engine.util.FormatFactory FormatFactory}
219      * interface to use with this report.
220      */

221     public String JavaDoc getFormatFactoryClass();
222
223     /**
224      * Gets the base name of the report associated resource bundle.
225      */

226     public String JavaDoc getResourceBundle();
227
228     /**
229      * Gets an array of report properties names.
230      */

231     public String JavaDoc[] getPropertyNames();
232
233     /**
234      * Gets a property value
235      * @param name the property name
236      */

237     public String JavaDoc getProperty(String JavaDoc name);
238
239     /**
240      *
241      */

242     public void setProperty(String JavaDoc name, String JavaDoc value);
243
244     /**
245      *
246      */

247     public void removeProperty(String JavaDoc name);
248
249     /**
250      * Gets an array of imports (needed if report expression require additional classes in order to compile).
251      */

252     public String JavaDoc[] getImports();
253
254     /**
255      * Gets an array of report fonts.
256      */

257     public JRReportFont[] getFonts();
258
259     /**
260      * Gets an array of report styles.
261      */

262     public JRStyle[] getStyles();
263
264     /**
265      *
266      */

267     public JRParameter[] getParameters();
268
269     /**
270      *
271      */

272     public JRQuery getQuery();
273
274     /**
275      *
276      */

277     public JRField[] getFields();
278
279     /**
280      *
281      */

282     public JRSortField[] getSortFields();
283
284     /**
285      *
286      */

287     public JRVariable[] getVariables();
288
289     /**
290      *
291      */

292     public JRGroup[] getGroups();
293
294     /**
295      *
296      */

297     public JRBand getBackground();
298
299     /**
300      *
301      */

302     public JRBand getTitle();
303
304     /**
305      *
306      */

307     public JRBand getPageHeader();
308
309     /**
310      *
311      */

312     public JRBand getColumnHeader();
313
314     /**
315      *
316      */

317     public JRBand getDetail();
318
319     /**
320      *
321      */

322     public JRBand getColumnFooter();
323
324     /**
325      *
326      */

327     public JRBand getPageFooter();
328
329     /**
330      *
331      */

332     public JRBand getLastPageFooter();
333
334     /**
335      *
336      */

337     public JRBand getSummary();
338
339     /**
340      * Returns the resource missing handling type.
341      */

342     public byte getWhenResourceMissingType();
343         
344     /**
345      * Sets the resource missing handling type.
346      * @param whenResourceMissingType the resource missing handling type
347      */

348     public void setWhenResourceMissingType(byte whenResourceMissingType);
349
350     
351     /**
352      * Returns the main report dataset.
353      * <p>
354      * The main report dataset consists of all parameters, fields, variables and groups of the report.
355      *
356      * @return the main report dataset
357      */

358     public JRDataset getMainDataset();
359     
360     
361     /**
362      * Returns the datasets of this report.
363      *
364      * @return the datasets of this report
365      */

366     public JRDataset[] getDatasets();
367     
368     
369     /**
370      * Decides whether to use pagination when filling the report.
371      * <p>
372      * If set to <code>true</code> the report will be generated on one long page.
373      * <p>
374      * The design attribute can be overridden at fill time by the {@link JRParameter#IS_IGNORE_PAGINATION IS_IGNORE_PAGINATION}
375      * parameter.
376      *
377      * @return whether to use pagination when filling the report
378      */

379     public boolean isIgnorePagination();
380     
381     
382     /**
383      * Returns this report's properties map.
384      *
385      * @return this report's properties map
386      */

387     public JRPropertiesMap getPropertiesMap();
388 }
389
Popular Tags