| Method from net.sf.jasperreports.engine.design.JasperDesign Detail: |
public void addDataset(JRDesignDataset dataset) throws JRException {
if (datasetMap.containsKey(dataset.getName()))
{
throw new JRException("Duplicate declaration of dataset : " + dataset.getName());
}
datasetList.add(dataset);
datasetMap.put(dataset.getName(), dataset);
getEventSupport().fireCollectionElementAddedEvent(PROPERTY_DATASETS, dataset, datasetList.size() - 1);
}
Adds a sub dataset to the report. |
public void addField(JRField field) throws JRException {
mainDesignDataset.addField(field);
}
|
public void addFont(JRReportFont reportFont) throws JRException {
if (fontsMap.containsKey(reportFont.getName()))
{
throw new JRException("Duplicate declaration of report font : " + reportFont.getName());
}
fontsList.add(reportFont);
fontsMap.put(reportFont.getName(), reportFont);
if (reportFont.isDefault())
{
setDefaultFont(reportFont);
}
getEventSupport().fireCollectionElementAddedEvent(PROPERTY_FONTS, reportFont, fontsList.size() - 1);
} Deprecated!
Adds a report font, that can be referenced by text elements. |
public void addGroup(JRDesignGroup group) throws JRException {
mainDesignDataset.addGroup(group);
}
Gets a map of report groups. |
public void addImport(String value) {
if (importsSet == null)
{
importsSet = new HashSet();
}
if (importsSet.add(value))
{
getEventSupport().fireCollectionElementAddedEvent(PROPERTY_IMPORTS, value, importsSet.size() - 1);
}
}
Adds an import (needed if report expression require additional classes in order to compile). |
public void addParameter(JRParameter parameter) throws JRException {
mainDesignDataset.addParameter(parameter);
}
|
public void addSortField(JRSortField sortField) throws JRException {
mainDesignDataset.addSortField(sortField);
}
|
public void addStyle(JRStyle style) throws JRException {
if (stylesMap.containsKey(style.getName()))
{
throw new JRException("Duplicate declaration of report style : " + style.getName());
}
stylesList.add(style);
stylesMap.put(style.getName(), style);
if (style.isDefault())
{
setDefaultStyle(style);
}
getEventSupport().fireCollectionElementAddedEvent(PROPERTY_STYLES, style, stylesList.size() - 1);
}
Adds a report style, that can be referenced by report elements. |
public void addTemplate(JRReportTemplate template) {
templateList.add(template);
getEventSupport().fireCollectionElementAddedEvent(PROPERTY_TEMPLATES, template, templateList.size() - 1);
}
|
public void addVariable(JRDesignVariable variable) throws JRException {
mainDesignDataset.addVariable(variable);
}
|
protected List getCrosstabs() {
final List crosstabs = new ArrayList();
JRElementsVisitor.visitReport(this, new JRVisitorSupport()
{
public void visitCrosstab(JRCrosstab crosstab)
{
crosstabs.add(crosstab);
}
});
return crosstabs;
}
|
public Map getDatasetMap() {
return datasetMap;
}
Returns the sub datasets of the report indexed by name. |
public JRDataset[] getDatasets() {
JRDataset[] datasetArray = new JRDataset[datasetList.size()];
datasetList.toArray(datasetArray);
return datasetArray;
}
|
public List getDatasetsList() {
return datasetList;
}
Returns the list of report sub datasets. |
public Collection getExpressions() {
return JRExpressionCollector.collectExpressions(this);
}
Returns a collection of all report expressions. |
public List getFieldsList() {
return mainDesignDataset.getFieldsList();
}
Gets a list of report fields. |
public Map getFieldsMap() {
return mainDesignDataset.getFieldsMap();
}
Gets a map of report fields. |
public JRExpression getFilterExpression() {
return mainDesignDataset.getFilterExpression();
}
Returns the main dataset filter expression. |
public JRReportFont[] getFonts() {
JRReportFont[] fontsArray = new JRReportFont[fontsList.size()];
fontsList.toArray(fontsArray);
return fontsArray;
} Deprecated!
Gets an array of report level fonts. These fonts can be referenced by text elements. |
public List getFontsList() {
return fontsList;
} Deprecated!
Gets a list of report level fonts. These fonts can be referenced by text elements. |
public Map getFontsMap() {
return fontsMap;
} Deprecated!
|
public List getGroupsList() {
return mainDesignDataset.getGroupsList();
}
Gets an array of report groups. |
public Map getGroupsMap() {
return mainDesignDataset.getGroupsMap();
}
Gets a list of report groups. |
public JRDesignDataset getMainDesignDataset() {
return mainDesignDataset;
}
Returns the main report dataset. |
public List getParametersList() {
return mainDesignDataset.getParametersList();
}
Gets a list of report parameters (including built-in ones). |
public Map getParametersMap() {
return mainDesignDataset.getParametersMap();
}
Gets a map of report parameters (including built-in ones). |
public List getSortFieldsList() {
return mainDesignDataset.getSortFieldsList();
}
Gets a list of sort report fields. |
public JRStyle[] getStyles() {
JRStyle[] stylesArray = new JRStyle[stylesList.size()];
stylesList.toArray(stylesArray);
return stylesArray;
}
Gets an array of report level styles. These styles can be referenced by report elements. |
public List getStylesList() {
return stylesList;
}
Gets a list of report level styles. These styles can be referenced by report elements. |
public Map getStylesMap() {
return stylesMap;
}
|
public JRReportTemplate[] getTemplates() {
return (JRReportTemplate[]) templateList.toArray(new JRReportTemplate[templateList.size()]);
}
|
public List getVariablesList() {
return mainDesignDataset.getVariablesList();
}
Gets a list of report variables. |
public Map getVariablesMap() {
return mainDesignDataset.getVariablesMap();
}
Gets a map of report variables. |
public void preprocess() {
for (Iterator it = getCrosstabs().iterator(); it.hasNext();)
{
JRDesignCrosstab crosstab = (JRDesignCrosstab) it.next();
crosstab.preprocess();
}
}
Performs preliminary processing and calculations prior to compilation. |
public JRDataset removeDataset(String datasetName) {
return removeDataset(
(JRDataset)datasetMap.get(datasetName)
);
}
Removes a sub dataset from the report. |
public JRDataset removeDataset(JRDataset dataset) {
if (dataset != null)
{
int idx = datasetList.indexOf(dataset);
if (idx >= 0)
{
datasetList.remove(idx);
datasetMap.remove(dataset.getName());
getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_DATASETS, dataset, idx);
}
}
return dataset;
}
Removes a sub dataset from the report. |
public JRField removeField(String fieldName) {
return mainDesignDataset.removeField(fieldName);
}
|
public JRField removeField(JRField field) {
return mainDesignDataset.removeField(field);
}
|
public JRReportFont removeFont(String propName) {
return removeFont(
(JRReportFont)fontsMap.get(propName)
);
} Deprecated!
Removes a report font from the list, based on the font name. |
public JRReportFont removeFont(JRReportFont reportFont) {
if (reportFont != null)
{
if (reportFont.isDefault())
{
setDefaultFont(null);
}
int idx = fontsList.indexOf(reportFont);
if (idx >= 0)
{
fontsList.remove(idx);
fontsMap.remove(reportFont.getName());
getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_FONTS, reportFont, idx);
}
}
return reportFont;
} Deprecated!
Removes a report font from the list. |
public JRGroup removeGroup(String groupName) {
return mainDesignDataset.removeGroup(groupName);
}
Adds a new group to the report design. Groups are nested. |
public JRGroup removeGroup(JRGroup group) {
return mainDesignDataset.removeGroup(group);
}
|
public void removeImport(String value) {
if (importsSet != null)
{
if (importsSet.remove(value))
{
getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_IMPORTS, value, -1);
}
}
}
|
public JRParameter removeParameter(String parameterName) {
return mainDesignDataset.removeParameter(parameterName);
}
Removes a report parameter, based on its name. |
public JRParameter removeParameter(JRParameter parameter) {
return mainDesignDataset.removeParameter(parameter);
}
Removes a report parameter. |
public JRSortField removeSortField(String fieldName) {
return mainDesignDataset.removeSortField(fieldName);
}
|
public JRSortField removeSortField(JRSortField sortField) {
return mainDesignDataset.removeSortField(sortField);
}
|
public JRStyle removeStyle(String styleName) {
return removeStyle(
(JRStyle)stylesMap.get(styleName)
);
}
Removes a report style from the list, based on the style name. |
public JRStyle removeStyle(JRStyle style) {
if (style != null)
{
if (style.isDefault())
{
setDefaultStyle(null);
}
int idx = stylesList.indexOf(style);
if (idx >= 0)
{
stylesList.remove(idx);
stylesMap.remove(style.getName());
getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_STYLES, style, idx);
}
}
return style;
}
Removes a report style from the list. |
public boolean removeTemplate(JRReportTemplate template) {
int idx = templateList.indexOf(template);
if (idx >= 0)
{
templateList.remove(idx);
getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_TEMPLATES, template, idx);
return true;
}
return false;
}
Removes a report template. |
public JRVariable removeVariable(String variableName) {
return mainDesignDataset.removeVariable(variableName);
}
|
public JRVariable removeVariable(JRVariable variable) {
return mainDesignDataset.removeVariable(variable);
}
|
public void setBackground(JRBand background) {
Object old = this.background;
this.background = background;
setBandOrigin(this.background, JROrigin.BACKGROUND);
getEventSupport().firePropertyChange(PROPERTY_BACKGROUND, old, this.background);
}
Sets the background band. |
protected void setBandOrigin(JRBand band,
byte type) {
if (band instanceof JRDesignBand)
{
JROrigin origin = new JROrigin(type);
((JRDesignBand) band).setOrigin(origin);
}
}
|
public void setBottomMargin(int bottomMargin) {
int old = this.bottomMargin;
this.bottomMargin = bottomMargin;
getEventSupport().firePropertyChange(PROPERTY_BOTTOM_MARGIN, old, this.bottomMargin);
}
Sets the top margin. The working space is calculated by subtracting the margins from the page height. |
public void setColumnCount(int columnCount) {
int old = this.columnCount;
this.columnCount = columnCount;
getEventSupport().firePropertyChange(PROPERTY_COLUMN_COUNT, old, this.columnCount);
}
Specifies the number of report columns. |
public void setColumnFooter(JRBand columnFooter) {
Object old = this.columnFooter;
this.columnFooter = columnFooter;
setBandOrigin(this.columnFooter, JROrigin.COLUMN_FOOTER);
getEventSupport().firePropertyChange(PROPERTY_COLUMN_FOOTER, old, this.columnFooter);
}
Sets the column footer band. |
public void setColumnHeader(JRBand columnHeader) {
Object old = this.columnHeader;
this.columnHeader = columnHeader;
setBandOrigin(this.columnHeader, JROrigin.COLUMN_HEADER);
getEventSupport().firePropertyChange(PROPERTY_COLUMN_HEADER, old, this.columnHeader);
}
Sets the column header band. |
public void setColumnSpacing(int columnSpacing) {
int old = this.columnSpacing;
this.columnSpacing = columnSpacing;
getEventSupport().firePropertyChange(PROPERTY_COLUMN_SPACING, old, this.columnSpacing);
}
Sets the spacing between columns. |
public void setColumnWidth(int columnWidth) {
int old = columnWidth;
this.columnWidth = columnWidth;
getEventSupport().firePropertyChange(PROPERTY_COLUMN_WIDTH, old, this.columnWidth);
}
|
public void setDefaultFont(JRReportFont font) {
Object old = this.defaultFont;
this.defaultFont = font;
getEventSupport().firePropertyChange(PROPERTY_DEFAULT_FONT, old, this.defaultFont);
} Deprecated!
|
public void setDefaultStyle(JRStyle style) {
Object old = this.defaultStyle;
this.defaultStyle = style;
getEventSupport().firePropertyChange(PROPERTY_DEFAULT_STLYE, old, this.defaultStyle);
}
|
public void setDetail(JRBand detail) {
Object old = this.detail;
this.detail = detail;
setBandOrigin(this.detail, JROrigin.DETAIL);
getEventSupport().firePropertyChange(PROPERTY_DETAIL, old, this.detail);
}
|
public void setFilterExpression(JRExpression expression) {
mainDesignDataset.setFilterExpression(expression);
}
Sets the main dataset filter expression. |
public void setFloatColumnFooter(boolean isFloatColumnFooter) {
boolean old = this.isFloatColumnFooter;
this.isFloatColumnFooter = isFloatColumnFooter;
getEventSupport().firePropertyChange(PROPERTY_FLOAT_COLUMN_FOOTER, old, this.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. |
public void setFormatFactoryClass(String formatFactoryClass) {
Object old = this.formatFactoryClass;
this.formatFactoryClass = formatFactoryClass;
getEventSupport().firePropertyChange(PROPERTY_FORMAT_FACTORY_CLASS, old, this.formatFactoryClass);
}
|
public void setIgnorePagination(boolean ignorePagination) {
boolean old = this.ignorePagination;
this.ignorePagination = ignorePagination;
getEventSupport().firePropertyChange(PROPERTY_IGNORE_PAGINATION, old, this.ignorePagination);
}
Sets the value of the ignore pagination flag. |
public void setLanguage(String language) {
Object old = this.language;
this.language = language;
getEventSupport().firePropertyChange(PROPERTY_LANGUAGE, old, this.language);
}
Specifies the language used for report expressions (Java or Groovy). The default is Java. |
public void setLastPageFooter(JRBand lastPageFooter) {
Object old = this.lastPageFooter;
this.lastPageFooter = lastPageFooter;
setBandOrigin(this.lastPageFooter, JROrigin.LAST_PAGE_FOOTER);
getEventSupport().firePropertyChange(PROPERTY_LAST_PAGE_FOOTER, old, this.lastPageFooter);
}
Sets the last page footer band. |
public void setLeftMargin(int leftMargin) {
int old = this.leftMargin;
this.leftMargin = leftMargin;
getEventSupport().firePropertyChange(PROPERTY_LEFT_MARGIN, old, this.leftMargin);
}
Sets the left margin. The working space is calculated by subtracting the margins from the page width. |
public void setMainDataset(JRDesignDataset dataset) {
Object old = this.background;
this.mainDataset = this.mainDesignDataset = dataset;
this.mainDesignDataset.setName(getName());
this.mainDesignDataset.getEventSupport().addPropertyChangeListener(new PropagationChangeListener(getEventSupport()));
getEventSupport().firePropertyChange(PROPERTY_MAIN_DATASET, old, this.mainDataset);
}
Sets the main report dataset.
This method can be used as an alternative to setting the parameters, fields, etc directly on the report. |
public void setName(String name) {
Object old = this.name;
this.name = name;
this.mainDesignDataset.setName(name);
getEventSupport().firePropertyChange(PROPERTY_NAME, old, this.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. |
public void setNoData(JRBand noData) {
Object old = this.noData;
this.noData = noData;
setBandOrigin(this.noData, JROrigin.NO_DATA);
getEventSupport().firePropertyChange(PROPERTY_NO_DATA, old, this.noData);
}
|
public void setOrientation(byte orientation) {
int old = this.orientation;
this.orientation = orientation;
getEventSupport().firePropertyChange(PROPERTY_ORIENTATION, old, this.orientation);
}
Sets the report orientation. |
public void setPageFooter(JRBand pageFooter) {
Object old = this.pageFooter;
this.pageFooter = pageFooter;
setBandOrigin(this.pageFooter, JROrigin.PAGE_FOOTER);
getEventSupport().firePropertyChange(PROPERTY_PAGE_FOOTER, old, this.pageFooter);
}
Sets the page footer band. |
public void setPageHeader(JRBand pageHeader) {
Object old = this.pageHeader;
this.pageHeader = pageHeader;
setBandOrigin(this.pageHeader, JROrigin.PAGE_HEADER);
getEventSupport().firePropertyChange(PROPERTY_PAGE_HEADER, old, this.pageHeader);
}
Sets the page header band. |
public void setPageHeight(int pageHeight) {
int old = this.pageHeight;
this.pageHeight = pageHeight;
getEventSupport().firePropertyChange(PROPERTY_PAGE_HEIGHT, old, this.pageHeight);
}
Sets page height (including margins etc.). Default is 842. |
public void setPageWidth(int pageWidth) {
int old = this.pageWidth;
this.pageWidth = pageWidth;
getEventSupport().firePropertyChange(PROPERTY_PAGE_WIDTH, old, this.pageWidth);
}
Sets page width (including margins etc.). Default is 595. |
public void setPrintOrder(byte printOrder) {
int old = this.printOrder;
this.printOrder = printOrder;
getEventSupport().firePropertyChange(PROPERTY_PRINT_ORDER, old, this.printOrder);
}
Sets the print order. In case of multiple column reports, the engine can perform vertical or horizontal fill. |
public void setQuery(JRDesignQuery query) {
mainDesignDataset.setQuery(query);
}
Specifies the report query. |
public void setResourceBundle(String resourceBundle) {
mainDesignDataset.setResourceBundle(resourceBundle);
}
Sets the base name of the report associated resource bundle. |
public void setRightMargin(int rightMargin) {
int old = this.rightMargin;
this.rightMargin = rightMargin;
getEventSupport().firePropertyChange(PROPERTY_RIGHT_MARGIN, old, this.rightMargin);
}
Sets the right margin. The working space is calculated by subtracting the margins from the page width. |
public void setScriptletClass(String scriptletClass) {
mainDesignDataset.setScriptletClass(scriptletClass);
}
|
public void setSummary(JRBand summary) {
Object old = this.summary;
this.summary = summary;
setBandOrigin(this.summary, JROrigin.SUMMARY);
getEventSupport().firePropertyChange(PROPERTY_SUMMARY, old, this.summary);
}
|
public void setSummaryNewPage(boolean isSummaryNewPage) {
boolean old = this.isSummaryNewPage;
this.isSummaryNewPage = isSummaryNewPage;
getEventSupport().firePropertyChange(PROPERTY_SUMMARY_NEW_PAGE, old, this.isSummaryNewPage);
}
Flag used to specify if the summary section should be printed on a separate last page. |
public void setTitle(JRBand title) {
Object old = this.title;
this.title = title;
setBandOrigin(this.title, JROrigin.TITLE);
getEventSupport().firePropertyChange(PROPERTY_TITLE, old, this.title);
}
|
public void setTitleNewPage(boolean isTitleNewPage) {
boolean old = this.isTitleNewPage;
this.isTitleNewPage = isTitleNewPage;
getEventSupport().firePropertyChange(PROPERTY_TITLE_NEW_PAGE, old, this.isTitleNewPage);
}
Flag used to specify if the title section should be printed on a separate initial page. |
public void setTopMargin(int topMargin) {
int old = this.topMargin;
this.topMargin = topMargin;
getEventSupport().firePropertyChange(PROPERTY_TOP_MARGIN, old, this.topMargin);
}
Sets the top margin. The working space is calculated by subtracting the margins from the page height. |