Class ReportWriter
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriterContext
-
- org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriter
-
public class ReportWriter extends ReportWriterContext
A report writer.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description ReportWriter(MasterReport reportDefinition, String encoding)
ReportWriter(MasterReport report, String encoding, org.pentaho.reporting.libraries.base.config.Configuration config)
Creates a new report writer for a report.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClassFactoryFactory(ClassFactory cf)
Adds a class factory.void
addDataSourceFactory(DataSourceFactory dsf)
Adds a data-source factory.void
addElementFactory(ElementFactory ef)
Adds an element factory.void
addStyleKeyFactory(StyleKeyFactory skf)
Adds a style-key factory.void
addTemplateCollection(TemplateCollection collection)
Adds a template collection.static org.pentaho.reporting.libraries.base.config.Configuration
createDefaultConfiguration(MasterReport report)
Builds a default configuration from a given report definition object.ClassFactoryCollector
getClassFactoryCollector()
Returns the class factory collector.org.pentaho.reporting.libraries.base.config.Configuration
getConfiguration()
Returns the configuration used to write the report.DataSourceCollector
getDataSourceCollector()
Returns the data-source collector.ElementFactoryCollector
getElementFactoryCollector()
Returns the element factory collector.String
getEncoding()
Returns the encoding.StyleKeyFactoryCollector
getStyleKeyFactoryCollector()
Returns the style-key factory collector.TemplateCollector
getTemplateCollector()
Returns the template collector.void
write(Writer w)
Writes a report to a character stream writer.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.modules.parser.extwriter.ReportWriterContext
getReport, hasParent
-
-
-
-
Constructor Detail
-
ReportWriter
public ReportWriter(MasterReport reportDefinition, String encoding)
-
ReportWriter
public ReportWriter(MasterReport report, String encoding, org.pentaho.reporting.libraries.base.config.Configuration config)
Creates a new report writer for a report.- Parameters:
report
- the report.encoding
- the encoding.config
- the write configuration.
-
-
Method Detail
-
createDefaultConfiguration
public static org.pentaho.reporting.libraries.base.config.Configuration createDefaultConfiguration(MasterReport report)
Builds a default configuration from a given report definition object. This will only create a valid definition, if the report has a valid content base object set.- Parameters:
report
- the report for which to create the writer configuration.- Returns:
- the generated configuration.
-
getEncoding
public String getEncoding()
Returns the encoding.- Returns:
- The encoding.
-
addDataSourceFactory
public void addDataSourceFactory(DataSourceFactory dsf)
Adds a data-source factory.- Parameters:
dsf
- the data-source factory.
-
getDataSourceCollector
public DataSourceCollector getDataSourceCollector()
Returns the data-source collector.- Overrides:
getDataSourceCollector
in classReportWriterContext
- Returns:
- The data-source collector.
-
addElementFactory
public void addElementFactory(ElementFactory ef)
Adds an element factory.- Parameters:
ef
- the element factory.
-
getElementFactoryCollector
public ElementFactoryCollector getElementFactoryCollector()
Returns the element factory collector.- Overrides:
getElementFactoryCollector
in classReportWriterContext
- Returns:
- The element factory collector.
-
addClassFactoryFactory
public void addClassFactoryFactory(ClassFactory cf)
Adds a class factory.- Parameters:
cf
- the class factory.
-
getClassFactoryCollector
public ClassFactoryCollector getClassFactoryCollector()
Returns the class factory collector.- Overrides:
getClassFactoryCollector
in classReportWriterContext
- Returns:
- The class factory collector.
-
addStyleKeyFactory
public void addStyleKeyFactory(StyleKeyFactory skf)
Adds a style-key factory.- Parameters:
skf
- the style-key factory.
-
getStyleKeyFactoryCollector
public StyleKeyFactoryCollector getStyleKeyFactoryCollector()
Returns the style-key factory collector.- Overrides:
getStyleKeyFactoryCollector
in classReportWriterContext
- Returns:
- The style-key factory collector.
-
addTemplateCollection
public void addTemplateCollection(TemplateCollection collection)
Adds a template collection.- Parameters:
collection
- the template collection.
-
getTemplateCollector
public TemplateCollector getTemplateCollector()
Returns the template collector.- Overrides:
getTemplateCollector
in classReportWriterContext
- Returns:
- The template collector.
-
write
public void write(Writer w) throws IOException, ReportWriterException
Writes a report to a character stream writer.- Parameters:
w
- the character stream writer.- Throws:
IOException
- if there is an I/O problem.ReportWriterException
- if there is a problem writing the report.
-
getConfiguration
public org.pentaho.reporting.libraries.base.config.Configuration getConfiguration()
Returns the configuration used to write the report.- Returns:
- the writer configuration.
-
-