Save This Page
Home » pentaho-reporting-engine-classic-0.8.10 » org » jfree » report » [javadoc | source]
org.jfree.report
public class: JFreeReport [javadoc | source]
java.lang.Object
   org.jfree.report.Element
      org.jfree.report.Section
         org.jfree.report.AbstractReportDefinition
            org.jfree.report.JFreeReport

All Implemented Interfaces:
    ReportDefinition, ReportElement, DataTarget

A JFreeReport instance is used as report template to define the visual layout of a report and to collect all data sources for the reporting. Possible data sources are the TableModel , Expression s or ReportParameterValues . The report is made up of 'bands', which are used repeatedly as necessary to generate small sections of the report.

Accessing the bands and the elements:

The different bands can be accessed using the main report definition (this class):

Groups can be queried using getGroup(int groupLevel). The group header and footer are accessible through the group object, so use getGroup(int groupLevel).getGroupHeader() and getGroup(int groupLevel).getGroupFooter().

All report elements share the same stylesheet collection. Report elements cannot be shared between two different report instances. Adding a report element to one band will remove it from the other one.

For dynamic computation of content you can add Expression s and org.jfree.report.function.Function s to the report.

Creating a new instance of JFreeReport seems to lock down the JDK on some Windows Systems, where no printer driver is installed. To prevent that behaviour on these systems, you can set the Configuration key "org.jfree.report.NoPrinterAvailable" to "false" and JFreeReport will use a hardcoded default page format instead.

A JFreeReport object always acts as Master-Report. The JFreeReport object defines the global report-configuration, the report's datasource (through the DataFactory property) and the ResourceBundleFactory (for localization).

Field Summary
public static final  String NAME_PROPERTY    Key for the 'report name' property. 
public static final  String REPORT_DATE_PROPERTY    Key for the 'report date' property. 
Fields inherited from org.jfree.report.Element:
ANONYMOUS_ELEMENT_PREFIX
Constructor:
 public JFreeReport() 
Method from org.jfree.report.JFreeReport Summary:
addStructureFunction,   clone,   getConfiguration,   getDataFactory,   getDataSchemaDefinition,   getName,   getPageDefinition,   getParameterDefinition,   getParameterValues,   getReportConfiguration,   getReportEnvironment,   getResourceBundleFactory,   getResourceManager,   getStructureFunction,   getStructureFunctionCount,   getStructureFunctions,   getTitle,   removeStructureFunction,   setDataFactory,   setDataSchemaDefinition,   setName,   setPageDefinition,   setParameterDefinition,   setProperty,   setReportEnvironment,   setResourceBundleFactory,   setResourceManager
Methods from org.jfree.report.AbstractReportDefinition:
addExpression,   addGroup,   clone,   getContentBase,   getDataRow,   getDefinitionSource,   getDetailsFooter,   getDetailsHeader,   getDocumentMetaData,   getElement,   getElementCount,   getExpressions,   getGroup,   getGroupByName,   getGroupCount,   getItemBand,   getNoDataBand,   getPageFooter,   getPageHeader,   getPreProcessor,   getProperties,   getProperty,   getQuery,   getQueryLimit,   getQueryTimeout,   getReportDefinition,   getReportFooter,   getReportHeader,   getRootGroup,   getStyleSheetCollection,   getWatermark,   removeElement,   removeGroup,   setContentBase,   setDefinitionSource,   setDetailsFooter,   setDetailsHeader,   setDocumentMetaData,   setExpressions,   setGroups,   setItemBand,   setNoDataBand,   setPageFooter,   setPageHeader,   setPreProcessor,   setProperty,   setQuery,   setQueryLimit,   setQueryTimeout,   setReportFooter,   setReportHeader,   setRootGroup,   setWatermark
Methods from org.jfree.report.Section:
createGlobalDefaultStyle,   getElement,   getElementCount,   registerAsChild,   removeElement,   unregisterAsChild,   unregisterParent,   validateLooping
Methods from org.jfree.report.Element:
clone,   createGlobalDefaultStyle,   getAttribute,   getAttributeExpression,   getAttributeExpressionNames,   getAttributeExpressionNamespaces,   getAttributeNames,   getAttributeNamespaces,   getAttributes,   getContentBase,   getDataSource,   getDefinitionSource,   getElementType,   getElementTypeName,   getHRefTarget,   getId,   getMetaData,   getName,   getObjectID,   getParent,   getParentSection,   getReportDefinition,   getStyle,   getStyleExpression,   getStyleExpressions,   getTreeLock,   getValue,   isDynamicContent,   isVisible,   setAttribute,   setAttributeExpression,   setDataSource,   setDynamicContent,   setElementType,   setHRefTarget,   setId,   setName,   setParent,   setStyleExpression,   setVisible
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.report.JFreeReport Detail:
 public  void addStructureFunction(StructureFunction function) 
    Adds a structural function to the report. Structural functions perform content preparation and maintainance operations before elements are layouted or printed.

    Structural function can live on their own processing level and are evaluated after the user expressions but before the layout expressions have been evaluated.

 public Object clone() throws CloneNotSupportedException 
    Clones the report.
 public Configuration getConfiguration() 
    Returns the report's configuration.
 public DataFactory getDataFactory() 
    Returns the data factory that has been assigned to this report. The data factory will never be null.
 public DataSchemaDefinition getDataSchemaDefinition() 
 public String getName() 
    Returns the name of the report.

    You can reference the report name in your XML report template file using the key 'report.name'.

 public PageDefinition getPageDefinition() 
    Returns the logical page definition for this report.
 public ReportParameterDefinition getParameterDefinition() 
 public ReportParameterValues getParameterValues() 
 public ModifiableConfiguration getReportConfiguration() 
    Returns the report configuration.

    The report configuration is automatically set up when the report is first created, and uses the global JFreeReport configuration as its parent.

 public ReportEnvironment getReportEnvironment() 
 public ResourceBundleFactory getResourceBundleFactory() 
    Returns the resource bundle factory for this report definition. The ResourceBundleFactory is used in internationalized reports to create the resourcebundles holding the localized resources.
 public ResourceManager getResourceManager() 
    Returns the resource manager that was responsible for loading the report. This method will return a default manager if the report had been constructed otherwise.

    The resource manager of the report should be used for all resource loading activities during the report processing.

 public StructureFunction getStructureFunction(int index) 
    Returns the structure function at the given position.
 public int getStructureFunctionCount() 
    Returns the number of structural functions added to the report.
 public StructureFunction[] getStructureFunctions() 
    Returns a copy of all structure functions contained in the report. Modifying the function instances will not alter the functions contained in the report.
 public String getTitle() 
 public  void removeStructureFunction(StructureFunction f) 
    Removes the given function from the collection of structure functions. This removes only the first occurence of the function, in case a function has been added twice.
 public  void setDataFactory(DataFactory dataFactory) 
    Sets the data factory for the report.
 public  void setDataSchemaDefinition(DataSchemaDefinition dataSchemaDefinition) 
 public  void setName(String name) 
    Sets the name of the report.

    The report name is stored as a property (key JFreeReport#NAME_PROPERTY ) inside the report properties. If you supply null as the name, the property is removed.

 public  void setPageDefinition(PageDefinition format) 
    Defines the logical page definition for this report. If no format is defined the system's default page format is used.

    If there is no printer available and the JDK blocks during the printer discovery, you can set the Configuration key "org.jfree.report.NoPrinterAvailable" to "false" and JFreeReport will use a hardcoded default page format instead.

 public  void setParameterDefinition(ReportParameterDefinition parameterDefinition) 
 public  void setProperty(String key,
    Object value) 
Deprecated! Properties - should not be used. Use the master-report's parameters instead.

    Adds a property to the report.

    If a property with the given name already exists, the property will be updated with the new value. If the supplied value is null, the property will be removed.

    Developers are free to add any properties they want to a report, and then display those properties in the report. For example, you might add a 'user.name' property, so that you can display the username in the header of a report.

 public  void setReportEnvironment(ReportEnvironment reportEnvironment) 
 public  void setResourceBundleFactory(ResourceBundleFactory resourceBundleFactory) 
    Redefines the resource bundle factory for the report.
 public  void setResourceManager(ResourceManager resourceManager) 
    Assigns a new resource manager or clears the current one. If no resource manager is set anymore, the next call to 'getResourceManager' will recreate one.