KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > design > JasperDesign


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.design;
29
30 import java.util.ArrayList JavaDoc;
31 import java.util.Collection JavaDoc;
32 import java.util.HashMap JavaDoc;
33 import java.util.HashSet JavaDoc;
34 import java.util.Iterator JavaDoc;
35 import java.util.List JavaDoc;
36 import java.util.Map JavaDoc;
37
38 import net.sf.jasperreports.crosstabs.JRCrosstab;
39 import net.sf.jasperreports.crosstabs.design.JRDesignCrosstab;
40 import net.sf.jasperreports.engine.JRBand;
41 import net.sf.jasperreports.engine.JRConstants;
42 import net.sf.jasperreports.engine.JRDataset;
43 import net.sf.jasperreports.engine.JRElement;
44 import net.sf.jasperreports.engine.JRException;
45 import net.sf.jasperreports.engine.JRExpression;
46 import net.sf.jasperreports.engine.JRExpressionCollector;
47 import net.sf.jasperreports.engine.JRField;
48 import net.sf.jasperreports.engine.JRFrame;
49 import net.sf.jasperreports.engine.JRGroup;
50 import net.sf.jasperreports.engine.JRParameter;
51 import net.sf.jasperreports.engine.JRReportFont;
52 import net.sf.jasperreports.engine.JRSortField;
53 import net.sf.jasperreports.engine.JRStyle;
54 import net.sf.jasperreports.engine.JRVariable;
55 import net.sf.jasperreports.engine.base.JRBaseReport;
56
57
58 /**
59  * JasperDesign is used for in-memory representation of a report design. Instances of this class can be easily
60  * created from an XML template and viceversa. It contains all report properties and report elements in their design time
61  * state.
62  * <p>
63  * The main reason for using this class is for modifying report templates at run time. Although using compiled reports
64  * is usually recommended, sometimes people need to dinamically change a report design.
65  *
66  * @see net.sf.jasperreports.engine.xml.JRXmlLoader
67  * @author Teodor Danciu (teodord@users.sourceforge.net)
68  * @version $Id: JasperDesign.java 1485 2006-11-14 20:23:17 +0200 (Tue, 14 Nov 2006) teodord $
69  */

70 public class JasperDesign extends JRBaseReport
71 {
72     /**
73      *
74      */

75     private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
76
77     private Map JavaDoc fontsMap = new HashMap JavaDoc();
78     private List JavaDoc fontsList = new ArrayList JavaDoc();
79     private Map JavaDoc stylesMap = new HashMap JavaDoc();
80     private List JavaDoc stylesList = new ArrayList JavaDoc();
81
82     /**
83      * Main report dataset.
84      */

85     private JRDesignDataset mainDesignDataset;
86
87     /**
88      * Report sub datasets indexed by name.
89      */

90     private Map JavaDoc datasetMap = new HashMap JavaDoc();
91     private List JavaDoc datasetList = new ArrayList JavaDoc();
92     
93     private transient List JavaDoc crosstabs;
94     
95     /**
96      * Constructs a JasperDesign object and fills it with the default variables and parameters.
97      */

98     public JasperDesign()
99     {
100         setMainDataset(new JRDesignDataset(true));
101     }
102
103
104     /**
105      * Sets the report name. It is strongly recommended that the report name matches the .jrxml file name, since report compilers
106      * usually use this name for the compiled .jasper file.
107      */

108     public void setName(String JavaDoc name)
109     {
110         this.name = name;
111         this.mainDesignDataset.setName(name);
112     }
113
114
115     /**
116      * Specifies the language used for report expressions (Java or Groovy). The default is Java.
117      */

118     public void setLanguage(String JavaDoc language)
119     {
120         this.language = language;
121     }
122         
123
124     /**
125      * Specifies the number of report columns.
126      */

127     public void setColumnCount(int columnCount)
128     {
129         this.columnCount = columnCount;
130     }
131         
132
133     /**
134      * Sets the print order. In case of multiple column reports, the engine can perform vertical or horizontal fill.
135      * @see net.sf.jasperreports.engine.JRReport PRINT_ORDER_VERTICAL,
136      * @see net.sf.jasperreports.engine.JRReport PRINT_ORDER_HORIZONTAL
137      */

138     public void setPrintOrder(byte printOrder)
139     {
140         this.printOrder = printOrder;
141     }
142         
143
144     /**
145      * Sets page width (including margins etc.). Default is 595.
146      */

147     public void setPageWidth(int pageWidth)
148     {
149         this.pageWidth = pageWidth;
150     }
151         
152
153     /**
154      * Sets page height (including margins etc.). Default is 842.
155      */

156     public void setPageHeight(int pageHeight)
157     {
158         this.pageHeight = pageHeight;
159     }
160         
161
162     /**
163      * Sets the report orientation.
164      * @see net.sf.jasperreports.engine.JRReport ORIENTATION_PORTRAIT,
165      * @see net.sf.jasperreports.engine.JRReport ORIENTATION_LANDSCAPE
166      */

167     public void setOrientation(byte orientation)
168     {
169         this.orientation = orientation;
170     }
171         
172
173     /**
174      * Sets the column width.
175      */

176     public void setColumnWidth(int columnWidth)
177     {
178         this.columnWidth = columnWidth;
179     }
180         
181
182     /**
183      * Sets the spacing between columns.
184      */

185     public void setColumnSpacing(int columnSpacing)
186     {
187         this.columnSpacing = columnSpacing;
188     }
189         
190
191     /**
192      * Sets the left margin. The working space is calculated by subtracting the margins from the page width.
193      */

194     public void setLeftMargin(int leftMargin)
195     {
196         this.leftMargin = leftMargin;
197     }
198         
199
200     /**
201      * Sets the right margin. The working space is calculated by subtracting the margins from the page width.
202      */

203     public void setRightMargin(int rightMargin)
204     {
205         this.rightMargin = rightMargin;
206     }
207         
208
209     /**
210      * Sets the top margin. The working space is calculated by subtracting the margins from the page height.
211      */

212     public void setTopMargin(int topMargin)
213     {
214         this.topMargin = topMargin;
215     }
216         
217
218     /**
219      * Sets the top margin. The working space is calculated by subtracting the margins from the page height.
220      */

221     public void setBottomMargin(int bottomMargin)
222     {
223         this.bottomMargin = bottomMargin;
224     }
225         
226
227     /**
228      * Sets the background band.
229      */

230     public void setBackground(JRBand background)
231     {
232         this.background = background;
233     }
234         
235
236     /**
237      * Sets the title band.
238      */

239     public void setTitle(JRBand title)
240     {
241         this.title = title;
242     }
243         
244
245     /**
246      * Flag used to specify if the title section should be printed on a separate initial page.
247      *
248      * @param isTitleNewPage true if the title section should be displayed on a separate initial page, false if
249      * it will be displayed on the first page along with other sections.
250      */

251     public void setTitleNewPage(boolean isTitleNewPage)
252     {
253         this.isTitleNewPage = isTitleNewPage;
254     }
255         
256
257     /**
258      * Sets the summary band.
259      */

260     public void setSummary(JRBand summary)
261     {
262         this.summary = summary;
263     }
264         
265
266     /**
267      * Flag used to specify if the summary section should be printed on a separate last page.
268      *
269      * @param isSummaryNewPage true if the summary section should be displayed on a separate last page, false if
270      * it will be displayed on the last page along with other sections, if there is enough space.
271      */

272     public void setSummaryNewPage(boolean isSummaryNewPage)
273     {
274         this.isSummaryNewPage = isSummaryNewPage;
275     }
276         
277
278     /**
279      * Flag used to specify if the column footer section should be printed at the bottom of the column or if it
280      * should immediately follow the last detail or group footer printed on the current column.
281      */

282     public void setFloatColumnFooter(boolean isFloatColumnFooter)
283     {
284         this.isFloatColumnFooter = isFloatColumnFooter;
285     }
286         
287
288     /**
289      * Sets the page header band.
290      */

291     public void setPageHeader(JRBand pageHeader)
292     {
293         this.pageHeader = pageHeader;
294     }
295         
296
297     /**
298      * Sets the page footer band.
299      */

300     public void setPageFooter(JRBand pageFooter)
301     {
302         this.pageFooter = pageFooter;
303     }
304         
305
306     /**
307      * Sets the last page footer band.
308      */

309     public void setLastPageFooter(JRBand lastPageFooter)
310     {
311         this.lastPageFooter = lastPageFooter;
312     }
313         
314
315     /**
316      * Sets the column header band.
317      */

318     public void setColumnHeader(JRBand columnHeader)
319     {
320         this.columnHeader = columnHeader;
321     }
322         
323
324     /**
325      * Sets the column footer band.
326      */

327     public void setColumnFooter(JRBand columnFooter)
328     {
329         this.columnFooter = columnFooter;
330     }
331         
332
333     /**
334      * Sets the detail band.
335      */

336     public void setDetail(JRBand detail)
337     {
338         this.detail = detail;
339     }
340         
341
342     /**
343      *
344      */

345     public void setScriptletClass(String JavaDoc scriptletClass)
346     {
347         mainDesignDataset.setScriptletClass(scriptletClass);
348     }
349         
350
351     /**
352      *
353      */

354     public void setFormatFactoryClass(String JavaDoc formatFactoryClass)
355     {
356         this.formatFactoryClass = formatFactoryClass;
357     }
358         
359
360     /**
361      * Sets the base name of the report associated resource bundle.
362      */

363     public void setResourceBundle(String JavaDoc resourceBundle)
364     {
365         mainDesignDataset.setResourceBundle(resourceBundle);
366     }
367         
368
369     /**
370      * Adds an import (needed if report expression require additional classes in order to compile).
371      */

372     public void addImport(String JavaDoc value)
373     {
374         if (importsSet == null)
375         {
376             importsSet = new HashSet JavaDoc();
377         }
378         importsSet.add(value);
379     }
380
381
382     /**
383      * Removes an import.
384      */

385     public void removeImport(String JavaDoc value)
386     {
387         if (importsSet != null)
388         {
389             importsSet.remove(value);
390         }
391     }
392
393
394     /**
395      * @deprecated
396      */

397     public void setDefaultFont(JRReportFont font)
398     {
399         this.defaultFont = font;
400     }
401         
402
403     /**
404      * Gets an array of report level fonts. These fonts can be referenced by text elements.
405      * @deprecated
406      */

407     public JRReportFont[] getFonts()
408     {
409         JRReportFont[] fontsArray = new JRReportFont[fontsList.size()];
410         
411         fontsList.toArray(fontsArray);
412
413         return fontsArray;
414     }
415     
416
417     /**
418      * Gets a list of report level fonts. These fonts can be referenced by text elements.
419      * @deprecated
420      */

421     public List JavaDoc getFontsList()
422     {
423         return fontsList;
424     }
425     
426
427     /**
428      * @deprecated
429      */

430     public Map JavaDoc getFontsMap()
431     {
432         return fontsMap;
433     }
434     
435
436     /**
437      * Adds a report font, that can be referenced by text elements.
438      * @deprecated
439      */

440     public void addFont(JRReportFont reportFont) throws JRException
441     {
442         if (fontsMap.containsKey(reportFont.getName()))
443         {
444             throw new JRException("Duplicate declaration of report font : " + reportFont.getName());
445         }
446
447         fontsList.add(reportFont);
448         fontsMap.put(reportFont.getName(), reportFont);
449         
450         if (reportFont.isDefault())
451         {
452             setDefaultFont(reportFont);
453         }
454     }
455     
456
457     /**
458      * Removes a report font from the list, based on the font name.
459      * @deprecated
460      */

461     public JRReportFont removeFont(String JavaDoc propName)
462     {
463         return removeFont(
464             (JRReportFont)fontsMap.get(propName)
465             );
466     }
467
468
469     /**
470      * Removes a report font from the list.
471      * @deprecated
472      */

473     public JRReportFont removeFont(JRReportFont reportFont)
474     {
475         if (reportFont != null)
476         {
477             if (reportFont.isDefault())
478             {
479                 setDefaultFont(null);
480             }
481
482             fontsList.remove(reportFont);
483             fontsMap.remove(reportFont.getName());
484         }
485
486         return reportFont;
487     }
488
489
490     /**
491      *
492      */

493     public void setDefaultStyle(JRStyle style)
494     {
495         this.defaultStyle = style;
496     }
497         
498
499     /**
500      * Gets an array of report level styles. These styles can be referenced by report elements.
501      */

502     public JRStyle[] getStyles()
503     {
504         JRStyle[] stylesArray = new JRStyle[stylesList.size()];
505
506         stylesList.toArray(stylesArray);
507
508         return stylesArray;
509     }
510
511
512     /**
513      * Gets a list of report level styles. These styles can be referenced by report elements.
514      */

515     public List JavaDoc getStylesList()
516     {
517         return stylesList;
518     }
519
520
521     /**
522      *
523      */

524     public Map JavaDoc getStylesMap()
525     {
526         return stylesMap;
527     }
528
529
530     /**
531      * Adds a report style, that can be referenced by report elements.
532      */

533     public void addStyle(JRStyle style) throws JRException
534     {
535         if (stylesMap.containsKey(style.getName()))
536         {
537             throw new JRException("Duplicate declaration of report style : " + style.getName());
538         }
539
540         stylesList.add(style);
541         stylesMap.put(style.getName(), style);
542         
543         if (style.isDefault())
544         {
545             setDefaultStyle(style);
546         }
547     }
548
549
550     /**
551      * Removes a report style from the list, based on the style name.
552      */

553     public JRStyle removeStyle(String JavaDoc styleName)
554     {
555         return removeStyle(
556             (JRStyle)stylesMap.get(styleName)
557             );
558     }
559
560
561     /**
562      * Removes a report style from the list.
563      */

564     public JRStyle removeStyle(JRStyle style)
565     {
566         if (style != null)
567         {
568             if (style.isDefault())
569             {
570                 setDefaultStyle(null);
571             }
572
573             stylesList.remove(style);
574             stylesMap.remove(style.getName());
575         }
576
577         return style;
578     }
579     
580
581     /**
582      * Gets a list of report parameters (including built-in ones).
583      */

584     public List JavaDoc getParametersList()
585     {
586         return mainDesignDataset.getParametersList();
587     }
588     
589
590     /**
591      * Gets a map of report parameters (including built-in ones).
592      */

593     public Map JavaDoc getParametersMap()
594     {
595         return mainDesignDataset.getParametersMap();
596     }
597     
598
599     /**
600      * Adds a report parameter.
601      */

602     public void addParameter(JRParameter parameter) throws JRException
603     {
604         mainDesignDataset.addParameter(parameter);
605     }
606     
607
608     /**
609      * Removes a report parameter, based on its name.
610      */

611     public JRParameter removeParameter(String JavaDoc parameterName)
612     {
613         return mainDesignDataset.removeParameter(parameterName);
614     }
615
616
617     /**
618      * Removes a report parameter.
619      */

620     public JRParameter removeParameter(JRParameter parameter)
621     {
622         return mainDesignDataset.removeParameter(parameter);
623     }
624
625
626     /**
627      * Specifies the report query. This is used only when datasource type is JDBC (a <tt>java.sql.Connection</tt>).
628      */

629     public void setQuery(JRDesignQuery query)
630     {
631         mainDesignDataset.setQuery(query);
632     }
633
634
635     /**
636      * Gets a list of report fields.
637      */

638     public List JavaDoc getFieldsList()
639     {
640         return mainDesignDataset.getFieldsList();
641     }
642     
643
644     /**
645      * Gets a map of report fields.
646      */

647     public Map JavaDoc getFieldsMap()
648     {
649         return mainDesignDataset.getFieldsMap();
650     }
651     
652
653     /**
654      *
655      */

656     public void addField(JRField field) throws JRException
657     {
658         mainDesignDataset.addField(field);
659     }
660     
661
662     /**
663      *
664      */

665     public JRField removeField(String JavaDoc fieldName)
666     {
667         return mainDesignDataset.removeField(fieldName);
668     }
669
670
671     /**
672      *
673      */

674     public JRField removeField(JRField field)
675     {
676         return mainDesignDataset.removeField(field);
677     }
678     
679
680     /**
681      * Gets a list of sort report fields.
682      */

683     public List JavaDoc getSortFieldsList()
684     {
685         return mainDesignDataset.getSortFieldsList();
686     }
687     
688
689     /**
690      *
691      */

692     public void addSortField(JRSortField sortField) throws JRException
693     {
694         mainDesignDataset.addSortField(sortField);
695     }
696     
697
698     /**
699      *
700      */

701     public JRSortField removeSortField(String JavaDoc fieldName)
702     {
703         return mainDesignDataset.removeSortField(fieldName);
704     }
705
706
707     /**
708      *
709      */

710     public JRSortField removeSortField(JRSortField sortField)
711     {
712         return mainDesignDataset.removeSortField(sortField);
713     }
714     
715
716     /**
717      * Gets a list of report variables.
718      */

719     public List JavaDoc getVariablesList()
720     {
721         return mainDesignDataset.getVariablesList();
722     }
723     
724
725     /**
726      * Gets a map of report variables.
727      */

728     public Map JavaDoc getVariablesMap()
729     {
730         return mainDesignDataset.getVariablesMap();
731     }
732     
733
734     /**
735      *
736      */

737     public void addVariable(JRDesignVariable variable) throws JRException
738     {
739         mainDesignDataset.addVariable(variable);
740     }
741     
742
743     /**
744      *
745      */

746     public JRVariable removeVariable(String JavaDoc variableName)
747     {
748         return mainDesignDataset.removeVariable(variableName);
749     }
750
751
752     /**
753      *
754      */

755     public JRVariable removeVariable(JRVariable variable)
756     {
757         return mainDesignDataset.removeVariable(variable);
758     }
759     
760
761     /**
762      * Gets an array of report groups.
763      */

764     public List JavaDoc getGroupsList()
765     {
766         return mainDesignDataset.getGroupsList();
767     }
768     
769
770     /**
771      * Gets a list of report groups.
772      */

773     public Map JavaDoc getGroupsMap()
774     {
775         return mainDesignDataset.getGroupsMap();
776     }
777     
778
779     /**
780      * Gets a map of report groups.
781      */

782     public void addGroup(JRDesignGroup group) throws JRException
783     {
784         mainDesignDataset.addGroup(group);
785     }
786     
787
788     /**
789      * Adds a new group to the report design. Groups are nested.
790      */

791     public JRGroup removeGroup(String JavaDoc groupName)
792     {
793         return mainDesignDataset.removeGroup(groupName);
794     }
795
796
797     /**
798      *
799      */

800     public JRGroup removeGroup(JRGroup group)
801     {
802         return mainDesignDataset.removeGroup(group);
803     }
804
805
806     /**
807      * Returns a collection of all report expressions.
808      */

809     public Collection JavaDoc getExpressions()
810     {
811         return JRExpressionCollector.collectExpressions(this);
812     }
813
814     
815     public JRDataset[] getDatasets()
816     {
817         JRDataset[] datasetArray = new JRDataset[datasetList.size()];
818         datasetList.toArray(datasetArray);
819         return datasetArray;
820     }
821
822     
823     
824     /**
825      * Returns the list of report sub datasets.
826      *
827      * @return list of {@link JRDesignDataset JRDesignDataset} objects
828      */

829     public List JavaDoc getDatasetsList()
830     {
831         return datasetList;
832     }
833     
834     
835     /**
836      * Returns the sub datasets of the report indexed by name.
837      *
838      * @return the sub datasets of the report indexed by name
839      */

840     public Map JavaDoc getDatasetMap()
841     {
842         return datasetMap;
843     }
844     
845     
846     /**
847      * Adds a sub dataset to the report.
848      *
849      * @param dataset the dataset
850      * @throws JRException
851      */

852     public void addDataset(JRDesignDataset dataset) throws JRException
853     {
854         if (datasetMap.containsKey(dataset.getName()))
855         {
856             throw new JRException("Duplicate declaration of dataset : " + dataset.getName());
857         }
858
859         datasetList.add(dataset);
860         datasetMap.put(dataset.getName(), dataset);
861     }
862     
863
864     /**
865      * Removes a sub dataset from the report.
866      *
867      * @param datasetName the dataset name
868      * @return the removed dataset
869      */

870     public JRDataset removeDataset(String JavaDoc datasetName)
871     {
872         return removeDataset(
873             (JRDataset)datasetMap.get(datasetName)
874             );
875     }
876
877
878     /**
879      * Removes a sub dataset from the report.
880      *
881      * @param dataset the dataset to be removed
882      * @return the dataset
883      */

884     public JRDataset removeDataset(JRDataset dataset)
885     {
886         if (dataset != null)
887         {
888             datasetList.remove(dataset);
889             datasetMap.remove(dataset.getName());
890         }
891         
892         return dataset;
893     }
894     
895     
896     /**
897      * Returns the main report dataset.
898      *
899      * @return the main report dataset
900      */

901     public JRDesignDataset getMainDesignDataset()
902     {
903         return mainDesignDataset;
904     }
905     
906     
907     /**
908      * Sets the main report dataset.
909      * <p>
910      * This method can be used as an alternative to setting the parameters, fields, etc directly on the report.
911      *
912      * @param dataset the dataset
913      */

914     public void setMainDataset(JRDesignDataset dataset)
915     {
916         this.mainDataset = this.mainDesignDataset = dataset;
917         this.mainDesignDataset.setName(getName());
918     }
919     
920     
921     /**
922      * Performs preliminary processing and calculations prior to compilation.
923      */

924     public void preprocess()
925     {
926         collectCrosstabs();
927         
928         for (Iterator JavaDoc it = crosstabs.iterator(); it.hasNext();)
929         {
930             JRDesignCrosstab crosstab = (JRDesignCrosstab) it.next();
931             crosstab.preprocess();
932         }
933     }
934     
935     protected List JavaDoc getCrosstabs()
936     {
937         if (crosstabs == null)
938         {
939             collectCrosstabs();
940         }
941         
942         return crosstabs;
943     }
944     
945     protected List JavaDoc collectCrosstabs()
946     {
947         crosstabs = new ArrayList JavaDoc();
948         collectCrosstabs(background);
949         collectCrosstabs(title);
950         collectCrosstabs(pageHeader);
951         collectCrosstabs(columnHeader);
952         collectCrosstabs(detail);
953         collectCrosstabs(columnFooter);
954         collectCrosstabs(pageFooter);
955         collectCrosstabs(lastPageFooter);
956         collectCrosstabs(summary);
957         
958         JRGroup[] groups = getGroups();
959         if (groups != null)
960         {
961             for (int i = 0; i < groups.length; i++)
962             {
963                 collectCrosstabs(groups[i].getGroupHeader());
964                 collectCrosstabs(groups[i].getGroupFooter());
965             }
966         }
967         
968         return crosstabs;
969     }
970     
971     protected void collectCrosstabs(JRBand band)
972     {
973         if (band != null)
974         {
975             collectCrosstabs(band.getElements());
976         }
977     }
978
979
980     protected void collectCrosstabs(JRElement[] elements)
981     {
982         if (elements != null)
983         {
984             for (int i = 0; i < elements.length; i++)
985             {
986                 JRElement element = elements[i];
987                 if (element instanceof JRCrosstab)
988                 {
989                     crosstabs.add(element);
990                 }
991                 else if (element instanceof JRFrame)
992                 {
993                     JRFrame frame = (JRFrame) element;
994                     collectCrosstabs(frame.getElements());
995                 }
996             }
997         }
998     }
999     
1000    
1001    /**
1002     * Sets the value of the ignore pagination flag.
1003     *
1004     * @param ignorePagination whether to ignore pagination when generating the report
1005     * @see net.sf.jasperreports.engine.JRReport#isIgnorePagination()
1006     */

1007    public void setIgnorePagination(boolean ignorePagination)
1008    {
1009        this.ignorePagination = ignorePagination;
1010    }
1011    
1012    
1013    /**
1014     * Returns the main dataset filter expression.
1015     *
1016     * @return the main dataset filter expression
1017     * @see JRDataset#getFilterExpression()
1018     */

1019    public JRExpression getFilterExpression()
1020    {
1021        return mainDesignDataset.getFilterExpression();
1022    }
1023
1024    
1025    /**
1026     * Sets the main dataset filter expression.
1027     *
1028     * @param expression the boolean expression to use as main dataset filter expression
1029     * @see JRDesignDataset#setFilterExpression(JRExpression)
1030     * @see JRDataset#getFilterExpression()
1031     */

1032    public void setFilterExpression(JRExpression expression)
1033    {
1034        mainDesignDataset.setFilterExpression(expression);
1035    }
1036}
1037
Popular Tags