net.sf.jasperreports.engine.design
Class JasperDesign

java.lang.Object
  extended by net.sf.jasperreports.engine.base.JRBaseReport
      extended by net.sf.jasperreports.engine.design.JasperDesign
All Implemented Interfaces:
java.io.Serializable, JRChangeEventsSupport, JRDefaultStyleProvider, JRIdentifiable, JRPropertiesHolder, JRReport

public class JasperDesign
extends JRBaseReport

JasperDesign is used for in-memory representation of a report design. Instances of this class can be easily created from an XML template and viceversa. It contains all report properties and report elements in their design time state.

The main reason for using this class is for modifying report templates at run time. Although using compiled reports is usually recommended, sometimes people need to dinamically change a report design.

Version:
$Id: JasperDesign.java 5337 2012-05-04 09:15:58Z lucianc $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
JRXmlLoader, Serialized Form

Field Summary
static java.lang.String PROPERTY_BACKGROUND
           
static java.lang.String PROPERTY_BOTTOM_MARGIN
           
static java.lang.String PROPERTY_COLUMN_COUNT
           
static java.lang.String PROPERTY_COLUMN_DIRECTION
           
static java.lang.String PROPERTY_COLUMN_FOOTER
           
static java.lang.String PROPERTY_COLUMN_HEADER
           
static java.lang.String PROPERTY_COLUMN_SPACING
           
static java.lang.String PROPERTY_COLUMN_WIDTH
           
static java.lang.String PROPERTY_DATASETS
           
static java.lang.String PROPERTY_DEFAULT_FONT
           
static java.lang.String PROPERTY_DEFAULT_STLYE
           
static java.lang.String PROPERTY_DETAIL
           
static java.lang.String PROPERTY_FLOAT_COLUMN_FOOTER
           
static java.lang.String PROPERTY_FONTS
           
static java.lang.String PROPERTY_FORMAT_FACTORY_CLASS
           
static java.lang.String PROPERTY_IGNORE_PAGINATION
           
static java.lang.String PROPERTY_IMPORTS
           
static java.lang.String PROPERTY_LANGUAGE
           
static java.lang.String PROPERTY_LAST_PAGE_FOOTER
           
static java.lang.String PROPERTY_LEFT_MARGIN
           
static java.lang.String PROPERTY_MAIN_DATASET
           
static java.lang.String PROPERTY_NAME
           
static java.lang.String PROPERTY_NO_DATA
           
static java.lang.String PROPERTY_ORIENTATION
           
static java.lang.String PROPERTY_PAGE_FOOTER
           
static java.lang.String PROPERTY_PAGE_HEADER
           
static java.lang.String PROPERTY_PAGE_HEIGHT
           
static java.lang.String PROPERTY_PAGE_WIDTH
           
static java.lang.String PROPERTY_PRINT_ORDER
           
static java.lang.String PROPERTY_RIGHT_MARGIN
           
static java.lang.String PROPERTY_STYLES
           
static java.lang.String PROPERTY_SUMMARY
           
static java.lang.String PROPERTY_SUMMARY_NEW_PAGE
           
static java.lang.String PROPERTY_SUMMARY_WITH_PAGE_HEADER_AND_FOOTER
           
static java.lang.String PROPERTY_TEMPLATES
           
static java.lang.String PROPERTY_TITLE
           
static java.lang.String PROPERTY_TITLE_NEW_PAGE
           
static java.lang.String PROPERTY_TOP_MARGIN
           
 
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseReport
background, bottomMargin, columnCount, columnDirection, columnFooter, columnHeader, columnSpacing, columnWidth, datasets, defaultStyle, detailSection, formatFactoryClass, ignorePagination, importsSet, isFloatColumnFooter, isSummaryNewPage, isSummaryWithPageHeaderAndFooter, isTitleNewPage, language, lastPageFooter, leftMargin, mainDataset, name, noData, orientationValue, pageFooter, pageHeader, pageHeight, pageWidth, printOrderValue, PROPERTY_WHEN_NO_DATA_TYPE, rightMargin, styles, summary, templates, title, topMargin, whenNoDataTypeValue
 
Fields inherited from interface net.sf.jasperreports.engine.JRReport
LANGUAGE_GROOVY, LANGUAGE_JAVA
 
Constructor Summary
JasperDesign()
          Constructs a JasperDesign object and fills it with the default variables and parameters.
 
Method Summary
 void addDataset(int index, JRDesignDataset dataset)
          Inserts a sub dataset at specified position into the report.
 void addDataset(JRDesignDataset dataset)
          Adds a sub dataset to the report.
 void addField(JRField field)
           
 void addGroup(JRDesignGroup group)
          Gets a map of report groups.
 void addImport(java.lang.String value)
          Adds an import (needed if report expression require additional classes in order to compile).
 void addParameter(JRParameter parameter)
          Adds a report parameter.
 void addScriptlet(JRScriptlet scriptlet)
          Adds a report scriplet.
 void addSortField(JRSortField sortField)
           
 void addStyle(int index, JRStyle style)
          Inserts a report style, that can be referenced by report elements, at specified position.
 void addStyle(JRStyle style)
          Adds a report style, that can be referenced by report elements.
 void addTemplate(int index, JRReportTemplate template)
          Inserts a report template at specified position.
 void addTemplate(JRReportTemplate template)
          Adds a report template.
 void addVariable(JRDesignVariable variable)
           
protected  java.util.List<JRCrosstab> getCrosstabs()
           
 java.util.Map<java.lang.String,JRDataset> getDatasetMap()
          Returns the sub datasets of the report indexed by name.
 JRDataset[] getDatasets()
          Returns the datasets of this report.
 java.util.List<JRDataset> getDatasetsList()
          Returns the list of report sub datasets.
 java.util.Collection<JRExpression> getExpressions()
          Returns a collection of all report expressions.
 java.util.List<JRField> getFieldsList()
          Gets a list of report fields.
 java.util.Map<java.lang.String,JRField> getFieldsMap()
          Gets a map of report fields.
 JRExpression getFilterExpression()
          Returns the main dataset filter expression.
 java.util.List<JRGroup> getGroupsList()
          Gets an array of report groups.
 java.util.Map<java.lang.String,JRGroup> getGroupsMap()
          Gets a list of report groups.
 JRDesignDataset getMainDesignDataset()
          Returns the main report dataset.
 java.util.List<JRParameter> getParametersList()
          Gets a list of report parameters (including built-in ones).
 java.util.Map<java.lang.String,JRParameter> getParametersMap()
          Gets a map of report parameters (including built-in ones).
 java.util.List<JRScriptlet> getScriptletsList()
          Gets a list of report scriptlets (excluding the one specified by scriptletClass).
 java.util.Map<java.lang.String,JRScriptlet> getScriptletsMap()
          Gets a map of report scriptlets (excluding the one specified by scriptletClass).
 java.util.List<JRSortField> getSortFieldsList()
          Gets a list of sort report fields.
 JRStyle[] getStyles()
          Gets an array of report level styles.
 java.util.List<JRStyle> getStylesList()
          Gets a list of report level styles.
 java.util.Map<java.lang.String,JRStyle> getStylesMap()
           
 JRReportTemplate[] getTemplates()
          Returns the list of report templates.
 java.util.List<JRReportTemplate> getTemplatesList()
          Returns the list of report templates defined in the report.
 java.util.List<JRVariable> getVariablesList()
          Gets a list of report variables.
 java.util.Map<java.lang.String,JRVariable> getVariablesMap()
          Gets a map of report variables.
 boolean hasUUID()
          Determines whether the report has an existing unique identifier.
 void preprocess()
          Performs preliminary processing and calculations prior to compilation.
 JRDataset removeDataset(JRDataset dataset)
          Removes a sub dataset from the report.
 JRDataset removeDataset(java.lang.String datasetName)
          Removes a sub dataset from the report.
 JRField removeField(JRField field)
           
 JRField removeField(java.lang.String fieldName)
           
 JRGroup removeGroup(JRGroup group)
           
 JRGroup removeGroup(java.lang.String groupName)
          Removes a new group from the report design.
 void removeImport(java.lang.String value)
          Removes an import.
 JRParameter removeParameter(JRParameter parameter)
          Removes a report parameter.
 JRParameter removeParameter(java.lang.String parameterName)
          Removes a report parameter, based on its name.
 JRScriptlet removeScriptlet(JRScriptlet scriptlet)
          Removes a report scriptlet.
 JRScriptlet removeScriptlet(java.lang.String scriptletName)
          Removes a report scriptlet, based on its name.
 JRSortField removeSortField(JRSortField sortField)
           
 JRSortField removeSortField(java.lang.String fieldName)
          Deprecated. To be removed.
 JRStyle removeStyle(JRStyle style)
          Removes a report style from the list.
 JRStyle removeStyle(java.lang.String styleName)
          Removes a report style from the list, based on the style name.
 boolean removeTemplate(JRReportTemplate template)
          Removes a report template.
 JRVariable removeVariable(JRVariable variable)
           
 JRVariable removeVariable(java.lang.String variableName)
           
 void resetDefaultStyle()
           
 void setBackground(JRBand background)
          Sets the background band.
protected  void setBandOrigin(JRBand band, BandTypeEnum type)
           
 void setBottomMargin(int bottomMargin)
          Sets the top margin.
 void setColumnCount(int columnCount)
          Specifies the number of report columns.
 void setColumnDirection(RunDirectionEnum columnDirection)
          Sets the column direction.
 void setColumnFooter(JRBand columnFooter)
          Sets the column footer band.
 void setColumnHeader(JRBand columnHeader)
          Sets the column header band.
 void setColumnSpacing(int columnSpacing)
          Sets the spacing between columns.
 void setColumnWidth(int columnWidth)
          Sets the column width.
 void setDefaultStyle(JRStyle style)
           
 void setFilterExpression(JRExpression expression)
          Sets the main dataset filter expression.
 void setFloatColumnFooter(boolean isFloatColumnFooter)
          Flag used to specify if the column footer section should be printed at the bottom of the column or if it should immediately follow the last detail or group footer printed on the current column.
 void setFormatFactoryClass(java.lang.String formatFactoryClass)
           
 void setIgnorePagination(boolean ignorePagination)
          Sets the value of the ignore pagination flag.
 void setLanguage(java.lang.String language)
          Specifies the language used for report expressions (Java or Groovy).
 void setLastPageFooter(JRBand lastPageFooter)
          Sets the last page footer band.
 void setLeftMargin(int leftMargin)
          Sets the left margin.
 void setMainDataset(JRDesignDataset dataset)
          Sets the main report dataset.
 void setName(java.lang.String name)
          Sets the report name.
 void setNoData(JRBand noData)
          Sets the noData band.
 void setOrientation(OrientationEnum orientationValue)
          Sets the report orientation.
 void setPageFooter(JRBand pageFooter)
          Sets the page footer band.
 void setPageHeader(JRBand pageHeader)
          Sets the page header band.
 void setPageHeight(int pageHeight)
          Sets page height (including margins etc.).
 void setPageWidth(int pageWidth)
          Sets page width (including margins etc.).
 void setPrintOrder(PrintOrderEnum printOrderValue)
          Sets the print order.
 void setQuery(JRDesignQuery query)
          Specifies the report query.
 void setResourceBundle(java.lang.String resourceBundle)
          Sets the base name of the report associated resource bundle.
 void setRightMargin(int rightMargin)
          Sets the right margin.
 void setScriptletClass(java.lang.String scriptletClass)
           
protected  void setSectionOrigin(JRSection section, BandTypeEnum type)
           
 void setSummary(JRBand summary)
          Sets the summary band.
 void setSummaryNewPage(boolean isSummaryNewPage)
          Flag used to specify if the summary section should be printed on a separate last page.
 void setSummaryWithPageHeaderAndFooter(boolean isSummaryWithPageHeaderAndFooter)
          Flag used to specify if the summary section should be accompanied by the page header and footer.
 void setTitle(JRBand title)
          Sets the title band.
 void setTitleNewPage(boolean isTitleNewPage)
          Flag used to specify if the title section should be printed on a separate initial page.
 void setTopMargin(int topMargin)
          Sets the top margin.
 void setUUID(java.util.UUID uuid)
          Sets the unique identifier for the report.
 
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseReport
copyTemplates, getAllBands, getBackground, getBottomMargin, getColumnCount, getColumnDirection, getColumnFooter, getColumnHeader, getColumnSpacing, getColumnWidth, getDefaultStyle, getDetailSection, getEventSupport, getFields, getFormatFactoryClass, getGroups, getImports, getLanguage, getLastPageFooter, getLeftMargin, getMainDataset, getName, getNoData, getOrientationValue, getPageFooter, getPageHeader, getPageHeight, getPageWidth, getParameters, getParentProperties, getPrintOrderValue, getPropertiesMap, getProperty, getPropertyNames, getQuery, getResourceBundle, getRightMargin, getScriptletClass, getScriptlets, getSortFields, getSummary, getTitle, getTopMargin, getUUID, getVariables, getWhenNoDataTypeValue, getWhenResourceMissingTypeValue, hasProperties, isFloatColumnFooter, isIgnorePagination, isSummaryNewPage, isSummaryWithPageHeaderAndFooter, isTitleNewPage, removeProperty, setProperty, setWhenNoDataType, setWhenResourceMissingType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_BACKGROUND

public static final java.lang.String PROPERTY_BACKGROUND
See Also:
Constant Field Values

PROPERTY_BOTTOM_MARGIN

public static final java.lang.String PROPERTY_BOTTOM_MARGIN
See Also:
Constant Field Values

PROPERTY_COLUMN_COUNT

public static final java.lang.String PROPERTY_COLUMN_COUNT
See Also:
Constant Field Values

PROPERTY_COLUMN_FOOTER

public static final java.lang.String PROPERTY_COLUMN_FOOTER
See Also:
Constant Field Values

PROPERTY_COLUMN_HEADER

public static final java.lang.String PROPERTY_COLUMN_HEADER
See Also:
Constant Field Values

PROPERTY_COLUMN_SPACING

public static final java.lang.String PROPERTY_COLUMN_SPACING
See Also:
Constant Field Values

PROPERTY_COLUMN_WIDTH

public static final java.lang.String PROPERTY_COLUMN_WIDTH
See Also:
Constant Field Values

PROPERTY_DATASETS

public static final java.lang.String PROPERTY_DATASETS
See Also:
Constant Field Values

PROPERTY_DEFAULT_FONT

public static final java.lang.String PROPERTY_DEFAULT_FONT
See Also:
Constant Field Values

PROPERTY_DEFAULT_STLYE

public static final java.lang.String PROPERTY_DEFAULT_STLYE
See Also:
Constant Field Values

PROPERTY_DETAIL

public static final java.lang.String PROPERTY_DETAIL
See Also:
Constant Field Values

PROPERTY_FLOAT_COLUMN_FOOTER

public static final java.lang.String PROPERTY_FLOAT_COLUMN_FOOTER
See Also:
Constant Field Values

PROPERTY_FONTS

public static final java.lang.String PROPERTY_FONTS
See Also:
Constant Field Values

PROPERTY_FORMAT_FACTORY_CLASS

public static final java.lang.String PROPERTY_FORMAT_FACTORY_CLASS
See Also:
Constant Field Values

PROPERTY_IGNORE_PAGINATION

public static final java.lang.String PROPERTY_IGNORE_PAGINATION
See Also:
Constant Field Values

PROPERTY_IMPORTS

public static final java.lang.String PROPERTY_IMPORTS
See Also:
Constant Field Values

PROPERTY_LANGUAGE

public static final java.lang.String PROPERTY_LANGUAGE
See Also:
Constant Field Values

PROPERTY_LAST_PAGE_FOOTER

public static final java.lang.String PROPERTY_LAST_PAGE_FOOTER
See Also:
Constant Field Values

PROPERTY_LEFT_MARGIN

public static final java.lang.String PROPERTY_LEFT_MARGIN
See Also:
Constant Field Values

PROPERTY_MAIN_DATASET

public static final java.lang.String PROPERTY_MAIN_DATASET
See Also:
Constant Field Values

PROPERTY_NAME

public static final java.lang.String PROPERTY_NAME
See Also:
Constant Field Values

PROPERTY_NO_DATA

public static final java.lang.String PROPERTY_NO_DATA
See Also:
Constant Field Values

PROPERTY_ORIENTATION

public static final java.lang.String PROPERTY_ORIENTATION
See Also:
Constant Field Values

PROPERTY_PAGE_FOOTER

public static final java.lang.String PROPERTY_PAGE_FOOTER
See Also:
Constant Field Values

PROPERTY_PAGE_HEADER

public static final java.lang.String PROPERTY_PAGE_HEADER
See Also:
Constant Field Values

PROPERTY_PAGE_HEIGHT

public static final java.lang.String PROPERTY_PAGE_HEIGHT
See Also:
Constant Field Values

PROPERTY_PAGE_WIDTH

public static final java.lang.String PROPERTY_PAGE_WIDTH
See Also:
Constant Field Values

PROPERTY_PRINT_ORDER

public static final java.lang.String PROPERTY_PRINT_ORDER
See Also:
Constant Field Values

PROPERTY_COLUMN_DIRECTION

public static final java.lang.String PROPERTY_COLUMN_DIRECTION
See Also:
Constant Field Values

PROPERTY_RIGHT_MARGIN

public static final java.lang.String PROPERTY_RIGHT_MARGIN
See Also:
Constant Field Values

PROPERTY_STYLES

public static final java.lang.String PROPERTY_STYLES
See Also:
Constant Field Values

PROPERTY_SUMMARY

public static final java.lang.String PROPERTY_SUMMARY
See Also:
Constant Field Values

PROPERTY_SUMMARY_NEW_PAGE

public static final java.lang.String PROPERTY_SUMMARY_NEW_PAGE
See Also:
Constant Field Values

PROPERTY_SUMMARY_WITH_PAGE_HEADER_AND_FOOTER

public static final java.lang.String PROPERTY_SUMMARY_WITH_PAGE_HEADER_AND_FOOTER
See Also:
Constant Field Values

PROPERTY_TEMPLATES

public static final java.lang.String PROPERTY_TEMPLATES
See Also:
Constant Field Values

PROPERTY_TITLE

public static final java.lang.String PROPERTY_TITLE
See Also:
Constant Field Values

PROPERTY_TITLE_NEW_PAGE

public static final java.lang.String PROPERTY_TITLE_NEW_PAGE
See Also:
Constant Field Values

PROPERTY_TOP_MARGIN

public static final java.lang.String PROPERTY_TOP_MARGIN
See Also:
Constant Field Values
Constructor Detail

JasperDesign

public JasperDesign()
Constructs a JasperDesign object and fills it with the default variables and parameters.

Method Detail

setName

public void setName(java.lang.String name)
Sets the report name. It is strongly recommended that the report name matches the .jrxml file name, since report compilers usually use this name for the compiled .jasper file.


setLanguage

public void setLanguage(java.lang.String language)
Specifies the language used for report expressions (Java or Groovy). The default is Java.


setColumnCount

public void setColumnCount(int columnCount)
Specifies the number of report columns.


setPrintOrder

public void setPrintOrder(PrintOrderEnum printOrderValue)
Sets the print order. In case of multiple column reports, the engine can perform vertical or horizontal fill.

See Also:
VERTICAL,, HORIZONTAL

setColumnDirection

public void setColumnDirection(RunDirectionEnum columnDirection)
Sets the column direction.


setPageWidth

public void setPageWidth(int pageWidth)
Sets page width (including margins etc.). Default is 595.


setPageHeight

public void setPageHeight(int pageHeight)
Sets page height (including margins etc.). Default is 842.


setOrientation

public void setOrientation(OrientationEnum orientationValue)
Sets the report orientation.

See Also:
ORIENTATION_PORTRAIT,, ORIENTATION_LANDSCAPE

setColumnWidth

public void setColumnWidth(int columnWidth)
Sets the column width.


setColumnSpacing

public void setColumnSpacing(int columnSpacing)
Sets the spacing between columns.


setLeftMargin

public void setLeftMargin(int leftMargin)
Sets the left margin. The working space is calculated by subtracting the margins from the page width.


setRightMargin

public void setRightMargin(int rightMargin)
Sets the right margin. The working space is calculated by subtracting the margins from the page width.


setTopMargin

public void setTopMargin(int topMargin)
Sets the top margin. The working space is calculated by subtracting the margins from the page height.


setBottomMargin

public void setBottomMargin(int bottomMargin)
Sets the top margin. The working space is calculated by subtracting the margins from the page height.


setBackground

public void setBackground(JRBand background)
Sets the background band.


setTitle

public void setTitle(JRBand title)
Sets the title band.


setTitleNewPage

public void setTitleNewPage(boolean isTitleNewPage)
Flag used to specify if the title section should be printed on a separate initial page.

Parameters:
isTitleNewPage - true if the title section should be displayed on a separate initial page, false if it will be displayed on the first page along with other sections.

setSummary

public void setSummary(JRBand summary)
Sets the summary band.


setNoData

public void setNoData(JRBand noData)
Sets the noData band.


setSummaryNewPage

public void setSummaryNewPage(boolean isSummaryNewPage)
Flag used to specify if the summary section should be printed on a separate last page.

Parameters:
isSummaryNewPage - true if the summary section should be displayed on a separate last page, false if it will be displayed on the last page along with other sections, if there is enough space.

setSummaryWithPageHeaderAndFooter

public void setSummaryWithPageHeaderAndFooter(boolean isSummaryWithPageHeaderAndFooter)
Flag used to specify if the summary section should be accompanied by the page header and footer.

Parameters:
isSummaryWithPageHeaderAndFooter - true if the summary section should be displayed on pages that have the page header and footer, false if it will be displayed on pages without header and footer.

setFloatColumnFooter

public void setFloatColumnFooter(boolean isFloatColumnFooter)
Flag used to specify if the column footer section should be printed at the bottom of the column or if it should immediately follow the last detail or group footer printed on the current column.


setPageHeader

public void setPageHeader(JRBand pageHeader)
Sets the page header band.


setPageFooter

public void setPageFooter(JRBand pageFooter)
Sets the page footer band.


setLastPageFooter

public void setLastPageFooter(JRBand lastPageFooter)
Sets the last page footer band.


setColumnHeader

public void setColumnHeader(JRBand columnHeader)
Sets the column header band.


setColumnFooter

public void setColumnFooter(JRBand columnFooter)
Sets the column footer band.


setScriptletClass

public void setScriptletClass(java.lang.String scriptletClass)

setFormatFactoryClass

public void setFormatFactoryClass(java.lang.String formatFactoryClass)

setResourceBundle

public void setResourceBundle(java.lang.String resourceBundle)
Sets the base name of the report associated resource bundle.


addImport

public void addImport(java.lang.String value)
Adds an import (needed if report expression require additional classes in order to compile).


removeImport

public void removeImport(java.lang.String value)
Removes an import.


resetDefaultStyle

public void resetDefaultStyle()

setDefaultStyle

public void setDefaultStyle(JRStyle style)

getStyles

public JRStyle[] getStyles()
Gets an array of report level styles. These styles can be referenced by report elements.

Specified by:
getStyles in interface JRReport
Overrides:
getStyles in class JRBaseReport

getStylesList

public java.util.List<JRStyle> getStylesList()
Gets a list of report level styles. These styles can be referenced by report elements.


getStylesMap

public java.util.Map<java.lang.String,JRStyle> getStylesMap()

addStyle

public void addStyle(JRStyle style)
              throws JRException
Adds a report style, that can be referenced by report elements.

Throws:
JRException

addStyle

public void addStyle(int index,
                     JRStyle style)
              throws JRException
Inserts a report style, that can be referenced by report elements, at specified position.

Throws:
JRException

removeStyle

public JRStyle removeStyle(java.lang.String styleName)
Removes a report style from the list, based on the style name.


removeStyle

public JRStyle removeStyle(JRStyle style)
Removes a report style from the list.


getScriptletsList

public java.util.List<JRScriptlet> getScriptletsList()
Gets a list of report scriptlets (excluding the one specified by scriptletClass).


getScriptletsMap

public java.util.Map<java.lang.String,JRScriptlet> getScriptletsMap()
Gets a map of report scriptlets (excluding the one specified by scriptletClass).


addScriptlet

public void addScriptlet(JRScriptlet scriptlet)
                  throws JRException
Adds a report scriplet.

Throws:
JRException

removeScriptlet

public JRScriptlet removeScriptlet(java.lang.String scriptletName)
Removes a report scriptlet, based on its name.


removeScriptlet

public JRScriptlet removeScriptlet(JRScriptlet scriptlet)
Removes a report scriptlet.


getParametersList

public java.util.List<JRParameter> getParametersList()
Gets a list of report parameters (including built-in ones).


getParametersMap

public java.util.Map<java.lang.String,JRParameter> getParametersMap()
Gets a map of report parameters (including built-in ones).


addParameter

public void addParameter(JRParameter parameter)
                  throws JRException
Adds a report parameter.

Throws:
JRException

removeParameter

public JRParameter removeParameter(java.lang.String parameterName)
Removes a report parameter, based on its name.


removeParameter

public JRParameter removeParameter(JRParameter parameter)
Removes a report parameter.


setQuery

public void setQuery(JRDesignQuery query)
Specifies the report query.


getFieldsList

public java.util.List<JRField> getFieldsList()
Gets a list of report fields.


getFieldsMap

public java.util.Map<java.lang.String,JRField> getFieldsMap()
Gets a map of report fields.


addField

public void addField(JRField field)
              throws JRException
Throws:
JRException

removeField

public JRField removeField(java.lang.String fieldName)

removeField

public JRField removeField(JRField field)

getSortFieldsList

public java.util.List<JRSortField> getSortFieldsList()
Gets a list of sort report fields.


addSortField

public void addSortField(JRSortField sortField)
                  throws JRException
Throws:
JRException

removeSortField

public JRSortField removeSortField(java.lang.String fieldName)
Deprecated. To be removed.


removeSortField

public JRSortField removeSortField(JRSortField sortField)

getVariablesList

public java.util.List<JRVariable> getVariablesList()
Gets a list of report variables.


getVariablesMap

public java.util.Map<java.lang.String,JRVariable> getVariablesMap()
Gets a map of report variables.


addVariable

public void addVariable(JRDesignVariable variable)
                 throws JRException
Throws:
JRException

removeVariable

public JRVariable removeVariable(java.lang.String variableName)

removeVariable

public JRVariable removeVariable(JRVariable variable)

getGroupsList

public java.util.List<JRGroup> getGroupsList()
Gets an array of report groups.


getGroupsMap

public java.util.Map<java.lang.String,JRGroup> getGroupsMap()
Gets a list of report groups.


addGroup

public void addGroup(JRDesignGroup group)
              throws JRException
Gets a map of report groups.

Throws:
JRException

removeGroup

public JRGroup removeGroup(java.lang.String groupName)
Removes a new group from the report design.


removeGroup

public JRGroup removeGroup(JRGroup group)

getExpressions

public java.util.Collection<JRExpression> getExpressions()
Returns a collection of all report expressions.


getDatasets

public JRDataset[] getDatasets()
Description copied from interface: JRReport
Returns the datasets of this report.

Specified by:
getDatasets in interface JRReport
Overrides:
getDatasets in class JRBaseReport
Returns:
the datasets of this report

getDatasetsList

public java.util.List<JRDataset> getDatasetsList()
Returns the list of report sub datasets.

Returns:
list of JRDesignDataset objects

getDatasetMap

public java.util.Map<java.lang.String,JRDataset> getDatasetMap()
Returns the sub datasets of the report indexed by name.

Returns:
the sub datasets of the report indexed by name

addDataset

public void addDataset(JRDesignDataset dataset)
                throws JRException
Adds a sub dataset to the report.

Parameters:
dataset - the dataset
Throws:
JRException

addDataset

public void addDataset(int index,
                       JRDesignDataset dataset)
                throws JRException
Inserts a sub dataset at specified position into the report.

Parameters:
index - the position
dataset - the dataset
Throws:
JRException

removeDataset

public JRDataset removeDataset(java.lang.String datasetName)
Removes a sub dataset from the report.

Parameters:
datasetName - the dataset name
Returns:
the removed dataset

removeDataset

public JRDataset removeDataset(JRDataset dataset)
Removes a sub dataset from the report.

Parameters:
dataset - the dataset to be removed
Returns:
the dataset

getMainDesignDataset

public JRDesignDataset getMainDesignDataset()
Returns the main report dataset.

Returns:
the main report dataset

setMainDataset

public void setMainDataset(JRDesignDataset dataset)
Sets the main report dataset.

This method can be used as an alternative to setting the parameters, fields, etc directly on the report.

Parameters:
dataset - the dataset

preprocess

public void preprocess()
Performs preliminary processing and calculations prior to compilation.


getCrosstabs

protected java.util.List<JRCrosstab> getCrosstabs()

setIgnorePagination

public void setIgnorePagination(boolean ignorePagination)
Sets the value of the ignore pagination flag.

Parameters:
ignorePagination - whether to ignore pagination when generating the report
See Also:
JRReport.isIgnorePagination()

getFilterExpression

public JRExpression getFilterExpression()
Returns the main dataset filter expression.

Returns:
the main dataset filter expression
See Also:
JRDataset.getFilterExpression()

setFilterExpression

public void setFilterExpression(JRExpression expression)
Sets the main dataset filter expression.

Parameters:
expression - the boolean expression to use as main dataset filter expression
See Also:
JRDesignDataset.setFilterExpression(JRExpression), JRDataset.getFilterExpression()

addTemplate

public void addTemplate(JRReportTemplate template)
Adds a report template.

Parameters:
template - the template to add.
See Also:
getTemplates()

addTemplate

public void addTemplate(int index,
                        JRReportTemplate template)
Inserts a report template at specified position.

Parameters:
index - the template position.
template - the template to insert.
See Also:
getTemplates()

removeTemplate

public boolean removeTemplate(JRReportTemplate template)
Removes a report template.

Parameters:
template - the template to remove
Returns:
true if and only if the template has been found and removed

getTemplates

public JRReportTemplate[] getTemplates()
Description copied from interface: JRReport
Returns the list of report templates.

A report template is an expression which resolves at runtime to a template. Templates include styles which can be used in the report.

The order in which the templates are included in the report is important:

Specified by:
getTemplates in interface JRReport
Overrides:
getTemplates in class JRBaseReport
Returns:
the list of report templates, or null if none
See Also:
JRTemplate, JRParameter.REPORT_TEMPLATES

getTemplatesList

public java.util.List<JRReportTemplate> getTemplatesList()
Returns the list of report templates defined in the report.

Returns:
the list of JRReportTemplate objects for the report
See Also:
getTemplates(), addTemplate(JRReportTemplate)

setBandOrigin

protected void setBandOrigin(JRBand band,
                             BandTypeEnum type)

setSectionOrigin

protected void setSectionOrigin(JRSection section,
                                BandTypeEnum type)

setUUID

public void setUUID(java.util.UUID uuid)
Sets the unique identifier for the report.

Parameters:
uuid - the identifier

hasUUID

public boolean hasUUID()
Determines whether the report has an existing unique identifier. Note that when no existing identifier is set, JRBaseReport.getUUID() would generate and return an identifier.

Returns:
whether the report has an externally set unique identifier
See Also:
setUUID(UUID)


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com