|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jasperreports.engine.base.JRBaseReport
net.sf.jasperreports.engine.design.JasperDesign
public class JasperDesign
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.
JRXmlLoader
,
Serialized FormField Summary |
---|
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseReport |
---|
background, bottomMargin, columnCount, columnFooter, columnHeader, columnSpacing, columnWidth, datasets, defaultFont, defaultStyle, detail, fonts, formatFactoryClass, ignorePagination, importsSet, isFloatColumnFooter, isSummaryNewPage, isTitleNewPage, language, lastPageFooter, leftMargin, mainDataset, name, orientation, pageFooter, pageHeader, pageHeight, pageWidth, printOrder, rightMargin, styles, summary, title, topMargin, whenNoDataType |
Fields inherited from interface net.sf.jasperreports.engine.JRReport |
---|
LANGUAGE_GROOVY, LANGUAGE_JAVA, ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, PRINT_ORDER_HORIZONTAL, PRINT_ORDER_VERTICAL, WHEN_NO_DATA_TYPE_ALL_SECTIONS_NO_DETAIL, WHEN_NO_DATA_TYPE_BLANK_PAGE, WHEN_NO_DATA_TYPE_NO_PAGES, WHEN_RESOURCE_MISSING_TYPE_EMPTY, WHEN_RESOURCE_MISSING_TYPE_ERROR, WHEN_RESOURCE_MISSING_TYPE_KEY, WHEN_RESOURCE_MISSING_TYPE_NULL |
Constructor Summary | |
---|---|
JasperDesign()
Constructs a JasperDesign object and fills it with the default variables and parameters. |
Method Summary | |
---|---|
void |
addDataset(JRDesignDataset dataset)
Adds a sub dataset to the report. |
void |
addField(JRField field)
|
void |
addFont(JRReportFont reportFont)
Deprecated. |
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 |
addSortField(JRSortField sortField)
|
void |
addStyle(JRStyle style)
Adds a report style, that can be referenced by report elements. |
void |
addVariable(JRDesignVariable variable)
|
protected java.util.List |
collectCrosstabs()
|
protected void |
collectCrosstabs(JRBand band)
|
protected void |
collectCrosstabs(JRElement[] elements)
|
protected java.util.List |
getCrosstabs()
|
java.util.Map |
getDatasetMap()
Returns the sub datasets of the report indexed by name. |
JRDataset[] |
getDatasets()
Returns the datasets of this report. |
java.util.List |
getDatasetsList()
Returns the list of report sub datasets. |
java.util.Collection |
getExpressions()
Returns a collection of all report expressions. |
java.util.List |
getFieldsList()
Gets a list of report fields. |
java.util.Map |
getFieldsMap()
Gets a map of report fields. |
JRExpression |
getFilterExpression()
Returns the main dataset filter expression. |
JRReportFont[] |
getFonts()
Deprecated. |
java.util.List |
getFontsList()
Deprecated. |
java.util.Map |
getFontsMap()
Deprecated. |
java.util.List |
getGroupsList()
Gets an array of report groups. |
java.util.Map |
getGroupsMap()
Gets a list of report groups. |
JRDesignDataset |
getMainDesignDataset()
Returns the main report dataset. |
java.util.List |
getParametersList()
Gets a list of report parameters (including built-in ones). |
java.util.Map |
getParametersMap()
Gets a map of report parameters (including built-in ones). |
java.util.List |
getSortFieldsList()
Gets a list of sort report fields. |
JRStyle[] |
getStyles()
Gets an array of report level styles. |
java.util.List |
getStylesList()
Gets a list of report level styles. |
java.util.Map |
getStylesMap()
|
java.util.List |
getVariablesList()
Gets a list of report variables. |
java.util.Map |
getVariablesMap()
Gets a map of report variables. |
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)
|
JRReportFont |
removeFont(JRReportFont reportFont)
Deprecated. |
JRReportFont |
removeFont(java.lang.String propName)
Deprecated. |
JRGroup |
removeGroup(JRGroup group)
|
JRGroup |
removeGroup(java.lang.String groupName)
Adds a new group to 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. |
JRSortField |
removeSortField(JRSortField sortField)
|
JRSortField |
removeSortField(java.lang.String fieldName)
|
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. |
JRVariable |
removeVariable(JRVariable variable)
|
JRVariable |
removeVariable(java.lang.String variableName)
|
void |
setBackground(JRBand background)
Sets the background band. |
void |
setBottomMargin(int bottomMargin)
Sets the top margin. |
void |
setColumnCount(int columnCount)
Specifies the number of report columns. |
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 |
setDefaultFont(JRReportFont font)
Deprecated. |
void |
setDefaultStyle(JRStyle style)
|
void |
setDetail(JRBand detail)
Sets the detail band. |
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 |
setOrientation(byte orientation)
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(byte printOrder)
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)
|
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JasperDesign()
Method Detail |
---|
public void setName(java.lang.String name)
public void setLanguage(java.lang.String language)
public void setColumnCount(int columnCount)
public void setPrintOrder(byte printOrder)
PRINT_ORDER_VERTICAL,
,
PRINT_ORDER_HORIZONTAL
public void setPageWidth(int pageWidth)
public void setPageHeight(int pageHeight)
public void setOrientation(byte orientation)
ORIENTATION_PORTRAIT,
,
ORIENTATION_LANDSCAPE
public void setColumnWidth(int columnWidth)
public void setColumnSpacing(int columnSpacing)
public void setLeftMargin(int leftMargin)
public void setRightMargin(int rightMargin)
public void setTopMargin(int topMargin)
public void setBottomMargin(int bottomMargin)
public void setBackground(JRBand background)
public void setTitle(JRBand title)
public void setTitleNewPage(boolean isTitleNewPage)
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.public void setSummary(JRBand summary)
public void setSummaryNewPage(boolean isSummaryNewPage)
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.public void setFloatColumnFooter(boolean isFloatColumnFooter)
public void setPageHeader(JRBand pageHeader)
public void setPageFooter(JRBand pageFooter)
public void setLastPageFooter(JRBand lastPageFooter)
public void setColumnHeader(JRBand columnHeader)
public void setColumnFooter(JRBand columnFooter)
public void setDetail(JRBand detail)
public void setScriptletClass(java.lang.String scriptletClass)
public void setFormatFactoryClass(java.lang.String formatFactoryClass)
public void setResourceBundle(java.lang.String resourceBundle)
public void addImport(java.lang.String value)
public void removeImport(java.lang.String value)
public void setDefaultFont(JRReportFont font)
public JRReportFont[] getFonts()
getFonts
in interface JRReport
getFonts
in class JRBaseReport
public java.util.List getFontsList()
public java.util.Map getFontsMap()
public void addFont(JRReportFont reportFont) throws JRException
JRException
public JRReportFont removeFont(java.lang.String propName)
public JRReportFont removeFont(JRReportFont reportFont)
public void setDefaultStyle(JRStyle style)
public JRStyle[] getStyles()
getStyles
in interface JRReport
getStyles
in class JRBaseReport
public java.util.List getStylesList()
public java.util.Map getStylesMap()
public void addStyle(JRStyle style) throws JRException
JRException
public JRStyle removeStyle(java.lang.String styleName)
public JRStyle removeStyle(JRStyle style)
public java.util.List getParametersList()
public java.util.Map getParametersMap()
public void addParameter(JRParameter parameter) throws JRException
JRException
public JRParameter removeParameter(java.lang.String parameterName)
public JRParameter removeParameter(JRParameter parameter)
public void setQuery(JRDesignQuery query)
public java.util.List getFieldsList()
public java.util.Map getFieldsMap()
public void addField(JRField field) throws JRException
JRException
public JRField removeField(java.lang.String fieldName)
public JRField removeField(JRField field)
public java.util.List getSortFieldsList()
public void addSortField(JRSortField sortField) throws JRException
JRException
public JRSortField removeSortField(java.lang.String fieldName)
public JRSortField removeSortField(JRSortField sortField)
public java.util.List getVariablesList()
public java.util.Map getVariablesMap()
public void addVariable(JRDesignVariable variable) throws JRException
JRException
public JRVariable removeVariable(java.lang.String variableName)
public JRVariable removeVariable(JRVariable variable)
public java.util.List getGroupsList()
public java.util.Map getGroupsMap()
public void addGroup(JRDesignGroup group) throws JRException
JRException
public JRGroup removeGroup(java.lang.String groupName)
public JRGroup removeGroup(JRGroup group)
public java.util.Collection getExpressions()
public JRDataset[] getDatasets()
JRReport
getDatasets
in interface JRReport
getDatasets
in class JRBaseReport
public java.util.List getDatasetsList()
JRDesignDataset
objectspublic java.util.Map getDatasetMap()
public void addDataset(JRDesignDataset dataset) throws JRException
dataset
- the dataset
JRException
public JRDataset removeDataset(java.lang.String datasetName)
datasetName
- the dataset name
public JRDataset removeDataset(JRDataset dataset)
dataset
- the dataset to be removed
public JRDesignDataset getMainDesignDataset()
public void setMainDataset(JRDesignDataset dataset)
This method can be used as an alternative to setting the parameters, fields, etc directly on the report.
dataset
- the datasetpublic void preprocess()
protected java.util.List getCrosstabs()
protected java.util.List collectCrosstabs()
protected void collectCrosstabs(JRBand band)
protected void collectCrosstabs(JRElement[] elements)
public void setIgnorePagination(boolean ignorePagination)
ignorePagination
- whether to ignore pagination when generating the reportJRReport.isIgnorePagination()
public JRExpression getFilterExpression()
JRDataset.getFilterExpression()
public void setFilterExpression(JRExpression expression)
expression
- the boolean expression to use as main dataset filter expressionJRDesignDataset.setFilterExpression(JRExpression)
,
JRDataset.getFilterExpression()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |