Save This Page
Home » jasperreports-3.0.0-project » net.sf.jasperreports.engine.design » [javadoc | source]
net.sf.jasperreports.engine.design
public class: JasperDesign [javadoc | source]
java.lang.Object
   net.sf.jasperreports.engine.base.JRBaseReport
      net.sf.jasperreports.engine.design.JasperDesign

All Implemented Interfaces:
    JRChangeEventsSupport, Serializable, JRReport

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.

Field Summary
public static final  String PROPERTY_BACKGROUND     
public static final  String PROPERTY_BOTTOM_MARGIN     
public static final  String PROPERTY_COLUMN_COUNT     
public static final  String PROPERTY_COLUMN_FOOTER     
public static final  String PROPERTY_COLUMN_HEADER     
public static final  String PROPERTY_COLUMN_SPACING     
public static final  String PROPERTY_COLUMN_WIDTH     
public static final  String PROPERTY_DATASETS     
public static final  String PROPERTY_DEFAULT_FONT     
public static final  String PROPERTY_DEFAULT_STLYE     
public static final  String PROPERTY_DETAIL     
public static final  String PROPERTY_FLOAT_COLUMN_FOOTER     
public static final  String PROPERTY_FONTS     
public static final  String PROPERTY_FORMAT_FACTORY_CLASS     
public static final  String PROPERTY_IGNORE_PAGINATION     
public static final  String PROPERTY_IMPORTS     
public static final  String PROPERTY_LANGUAGE     
public static final  String PROPERTY_LAST_PAGE_FOOTER     
public static final  String PROPERTY_LEFT_MARGIN     
public static final  String PROPERTY_MAIN_DATASET     
public static final  String PROPERTY_NAME     
public static final  String PROPERTY_NO_DATA     
public static final  String PROPERTY_ORIENTATION     
public static final  String PROPERTY_PAGE_FOOTER     
public static final  String PROPERTY_PAGE_HEADER     
public static final  String PROPERTY_PAGE_HEIGHT     
public static final  String PROPERTY_PAGE_WIDTH     
public static final  String PROPERTY_PRINT_ORDER     
public static final  String PROPERTY_RIGHT_MARGIN     
public static final  String PROPERTY_STYLES     
public static final  String PROPERTY_SUMMARY     
public static final  String PROPERTY_SUMMARY_NEW_PAGE     
public static final  String PROPERTY_TEMPLATES     
public static final  String PROPERTY_TITLE     
public static final  String PROPERTY_TITLE_NEW_PAGE     
public static final  String PROPERTY_TOP_MARGIN     
Fields inherited from net.sf.jasperreports.engine.base.JRBaseReport:
PROPERTY_WHEN_NO_DATA_TYPE,  name,  language,  columnCount,  printOrder,  pageWidth,  pageHeight,  orientation,  whenNoDataType,  columnWidth,  columnSpacing,  leftMargin,  rightMargin,  topMargin,  bottomMargin,  isTitleNewPage,  isSummaryNewPage,  isFloatColumnFooter,  ignorePagination,  formatFactoryClass,  importsSet,  templates,  defaultFont,  fonts,  defaultStyle,  styles,  mainDataset,  datasets,  background,  title,  pageHeader,  columnHeader,  detail,  columnFooter,  pageFooter,  lastPageFooter,  summary,  noData
Constructor:
 public JasperDesign() 
Method from net.sf.jasperreports.engine.design.JasperDesign Summary:
addDataset,   addField,   addFont,   addGroup,   addImport,   addParameter,   addSortField,   addStyle,   addTemplate,   addVariable,   getCrosstabs,   getDatasetMap,   getDatasets,   getDatasetsList,   getExpressions,   getFieldsList,   getFieldsMap,   getFilterExpression,   getFonts,   getFontsList,   getFontsMap,   getGroupsList,   getGroupsMap,   getMainDesignDataset,   getParametersList,   getParametersMap,   getSortFieldsList,   getStyles,   getStylesList,   getStylesMap,   getTemplates,   getVariablesList,   getVariablesMap,   preprocess,   removeDataset,   removeDataset,   removeField,   removeField,   removeFont,   removeFont,   removeGroup,   removeGroup,   removeImport,   removeParameter,   removeParameter,   removeSortField,   removeSortField,   removeStyle,   removeStyle,   removeTemplate,   removeVariable,   removeVariable,   setBackground,   setBandOrigin,   setBottomMargin,   setColumnCount,   setColumnFooter,   setColumnHeader,   setColumnSpacing,   setColumnWidth,   setDefaultFont,   setDefaultStyle,   setDetail,   setFilterExpression,   setFloatColumnFooter,   setFormatFactoryClass,   setIgnorePagination,   setLanguage,   setLastPageFooter,   setLeftMargin,   setMainDataset,   setName,   setNoData,   setOrientation,   setPageFooter,   setPageHeader,   setPageHeight,   setPageWidth,   setPrintOrder,   setQuery,   setResourceBundle,   setRightMargin,   setScriptletClass,   setSummary,   setSummaryNewPage,   setTitle,   setTitleNewPage,   setTopMargin
Methods from net.sf.jasperreports.engine.base.JRBaseReport:
copyTemplates,   getBackground,   getBottomMargin,   getColumnCount,   getColumnFooter,   getColumnHeader,   getColumnSpacing,   getColumnWidth,   getDatasets,   getDefaultFont,   getDefaultStyle,   getDetail,   getEventSupport,   getFields,   getFonts,   getFormatFactoryClass,   getGroups,   getImports,   getLanguage,   getLastPageFooter,   getLeftMargin,   getMainDataset,   getName,   getNoData,   getOrientation,   getPageFooter,   getPageHeader,   getPageHeight,   getPageWidth,   getParameters,   getParentProperties,   getPrintOrder,   getPropertiesMap,   getProperty,   getPropertyNames,   getQuery,   getResourceBundle,   getRightMargin,   getScriptletClass,   getSortFields,   getStyles,   getSummary,   getTemplates,   getTitle,   getTopMargin,   getVariables,   getWhenNoDataType,   getWhenResourceMissingType,   hasProperties,   isFloatColumnFooter,   isIgnorePagination,   isSummaryNewPage,   isTitleNewPage,   removeProperty,   setProperty,   setWhenNoDataType,   setWhenResourceMissingType
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from net.sf.jasperreports.engine.design.JasperDesign Detail:
 public  void addDataset(JRDesignDataset dataset) throws JRException 
    Adds a sub dataset to the report.
 public  void addField(JRField field) throws JRException 
 public  void addFont(JRReportFont reportFont) throws JRException 
Deprecated!
    Adds a report font, that can be referenced by text elements.
 public  void addGroup(JRDesignGroup group) throws JRException 
    Gets a map of report groups.
 public  void addImport(String value) 
    Adds an import (needed if report expression require additional classes in order to compile).
 public  void addParameter(JRParameter parameter) throws JRException 
    Adds a report parameter.
 public  void addSortField(JRSortField sortField) throws JRException 
 public  void addStyle(JRStyle style) throws JRException 
    Adds a report style, that can be referenced by report elements.
 public  void addTemplate(JRReportTemplate template) 
    Adds a report template.
 public  void addVariable(JRDesignVariable variable) throws JRException 
 protected List getCrosstabs() 
 public Map getDatasetMap() 
    Returns the sub datasets of the report indexed by name.
 public JRDataset[] getDatasets() 
 public List getDatasetsList() 
    Returns the list of report sub datasets.
 public Collection getExpressions() 
    Returns a collection of all report expressions.
 public List getFieldsList() 
    Gets a list of report fields.
 public Map getFieldsMap() 
    Gets a map of report fields.
 public JRExpression getFilterExpression() 
    Returns the main dataset filter expression.
 public JRReportFont[] getFonts() 
Deprecated!
    Gets an array of report level fonts. These fonts can be referenced by text elements.
 public List getFontsList() 
Deprecated!
    Gets a list of report level fonts. These fonts can be referenced by text elements.
 public Map getFontsMap() 
Deprecated!
 public List getGroupsList() 
    Gets an array of report groups.
 public Map getGroupsMap() 
    Gets a list of report groups.
 public JRDesignDataset getMainDesignDataset() 
    Returns the main report dataset.
 public List getParametersList() 
    Gets a list of report parameters (including built-in ones).
 public Map getParametersMap() 
    Gets a map of report parameters (including built-in ones).
 public List getSortFieldsList() 
    Gets a list of sort report fields.
 public JRStyle[] getStyles() 
    Gets an array of report level styles. These styles can be referenced by report elements.
 public List getStylesList() 
    Gets a list of report level styles. These styles can be referenced by report elements.
 public Map getStylesMap() 
 public JRReportTemplate[] getTemplates() 
 public List getVariablesList() 
    Gets a list of report variables.
 public Map getVariablesMap() 
    Gets a map of report variables.
 public  void preprocess() 
    Performs preliminary processing and calculations prior to compilation.
 public JRDataset removeDataset(String datasetName) 
    Removes a sub dataset from the report.
 public JRDataset removeDataset(JRDataset dataset) 
    Removes a sub dataset from the report.
 public JRField removeField(String fieldName) 
 public JRField removeField(JRField field) 
 public JRReportFont removeFont(String propName) 
Deprecated!
    Removes a report font from the list, based on the font name.
 public JRReportFont removeFont(JRReportFont reportFont) 
Deprecated!
    Removes a report font from the list.
 public JRGroup removeGroup(String groupName) 
    Adds a new group to the report design. Groups are nested.
 public JRGroup removeGroup(JRGroup group) 
 public  void removeImport(String value) 
    Removes an import.
 public JRParameter removeParameter(String parameterName) 
    Removes a report parameter, based on its name.
 public JRParameter removeParameter(JRParameter parameter) 
    Removes a report parameter.
 public JRSortField removeSortField(String fieldName) 
 public JRSortField removeSortField(JRSortField sortField) 
 public JRStyle removeStyle(String styleName) 
    Removes a report style from the list, based on the style name.
 public JRStyle removeStyle(JRStyle style) 
    Removes a report style from the list.
 public boolean removeTemplate(JRReportTemplate template) 
    Removes a report template.
 public JRVariable removeVariable(String variableName) 
 public JRVariable removeVariable(JRVariable variable) 
 public  void setBackground(JRBand background) 
    Sets the background band.
 protected  void setBandOrigin(JRBand band,
    byte type) 
 public  void setBottomMargin(int bottomMargin) 
    Sets the top margin. The working space is calculated by subtracting the margins from the page height.
 public  void setColumnCount(int columnCount) 
    Specifies the number of report columns.
 public  void setColumnFooter(JRBand columnFooter) 
    Sets the column footer band.
 public  void setColumnHeader(JRBand columnHeader) 
    Sets the column header band.
 public  void setColumnSpacing(int columnSpacing) 
    Sets the spacing between columns.
 public  void setColumnWidth(int columnWidth) 
    Sets the column width.
 public  void setDefaultFont(JRReportFont font) 
Deprecated!
 public  void setDefaultStyle(JRStyle style) 
 public  void setDetail(JRBand detail) 
    Sets the detail band.
 public  void setFilterExpression(JRExpression expression) 
    Sets the main dataset filter expression.
 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.
 public  void setFormatFactoryClass(String formatFactoryClass) 
 public  void setIgnorePagination(boolean ignorePagination) 
    Sets the value of the ignore pagination flag.
 public  void setLanguage(String language) 
    Specifies the language used for report expressions (Java or Groovy). The default is Java.
 public  void setLastPageFooter(JRBand lastPageFooter) 
    Sets the last page footer band.
 public  void setLeftMargin(int leftMargin) 
    Sets the left margin. The working space is calculated by subtracting the margins from the page width.
 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.

 public  void setName(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.
 public  void setNoData(JRBand noData) 
    Sets the noData band.
 public  void setOrientation(byte orientation) 
    Sets the report orientation.
 public  void setPageFooter(JRBand pageFooter) 
    Sets the page footer band.
 public  void setPageHeader(JRBand pageHeader) 
    Sets the page header band.
 public  void setPageHeight(int pageHeight) 
    Sets page height (including margins etc.). Default is 842.
 public  void setPageWidth(int pageWidth) 
    Sets page width (including margins etc.). Default is 595.
 public  void setPrintOrder(byte printOrder) 
    Sets the print order. In case of multiple column reports, the engine can perform vertical or horizontal fill.
 public  void setQuery(JRDesignQuery query) 
    Specifies the report query.
 public  void setResourceBundle(String resourceBundle) 
    Sets the base name of the report associated resource bundle.
 public  void setRightMargin(int rightMargin) 
    Sets the right margin. The working space is calculated by subtracting the margins from the page width.
 public  void setScriptletClass(String scriptletClass) 
 public  void setSummary(JRBand summary) 
    Sets the summary band.
 public  void setSummaryNewPage(boolean isSummaryNewPage) 
    Flag used to specify if the summary section should be printed on a separate last page.
 public  void setTitle(JRBand title) 
    Sets the title band.
 public  void setTitleNewPage(boolean isTitleNewPage) 
    Flag used to specify if the title section should be printed on a separate initial page.
 public  void setTopMargin(int topMargin) 
    Sets the top margin. The working space is calculated by subtracting the margins from the page height.