net.sf.jasperreports.engine
Class JasperCompileManager

java.lang.Object
  extended by net.sf.jasperreports.engine.JasperCompileManager

public class JasperCompileManager
extends java.lang.Object

Façade class for compiling report designs into the ready-to-fill form and for getting the XML representation of report design objects for storage or network transfer. Report compilation using this class is delegated to the JRDefaultCompiler.

Version:
$Id: JasperCompileManager.java 3033 2009-08-27 11:46:22Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
JasperDesign, JasperReport, JRDefaultCompiler, JRVerifier, JRXmlLoader, JRXmlWriter, JRLoader, JRSaver

Constructor Summary
JasperCompileManager()
           
 
Method Summary
static JasperReport compileReport(java.io.InputStream inputStream)
          Compiles the serialized report design object read from the supplied input stream and returns the generated compiled report design object.
static JasperReport compileReport(JasperDesign jasperDesign)
          Compiles the report design object received as parameter and returns the generated compiled report design object.
static JasperReport compileReport(java.lang.String sourceFileName)
          Compiles the XML report design file received as parameter, and returns the compiled report design object.
static void compileReportToFile(JasperDesign jasperDesign, java.lang.String destFileName)
          Compiles the report design object received as the first parameter, placing the result in the file specified by the second parameter.
static java.lang.String compileReportToFile(java.lang.String sourceFileName)
          Compiles the XML report design file specified by the parameter.
static void compileReportToFile(java.lang.String sourceFileName, java.lang.String destFileName)
          Compiles the XML report design file received as the first parameter, placing the result in the file specified by the second parameter.
static void compileReportToStream(java.io.InputStream inputStream, java.io.OutputStream outputStream)
          Compiles the XML representation of the report design read from the supplied input stream and writes the generated compiled report design object to the output stream specified by the second parameter.
static void compileReportToStream(JasperDesign jasperDesign, java.io.OutputStream outputStream)
          Compiles the report design object represented by the first parameter and writes the generated compiled report design object to the output stream specified by the second parameter.
static JREvaluator loadEvaluator(JasperReport jasperReport)
           
static JREvaluator loadEvaluator(JasperReport jasperReport, JRCrosstab crosstab)
           
static JREvaluator loadEvaluator(JasperReport jasperReport, JRDataset dataset)
           
static java.util.Collection verifyDesign(JasperDesign jasperDesign)
          Verifies the validity and consistency of the report design object.
static java.lang.String writeReportToXml(JRReport report)
          Generates the XML representation of the report design object supplied as parameter using the "UTF-8" enconding.
static void writeReportToXmlFile(JRReport report, java.lang.String destFileName)
          Generates the XML representation of the report design supplied as the first parameter and place it in the file specified by the second parameter.
static java.lang.String writeReportToXmlFile(java.lang.String sourceFileName)
          Generates the XML representation of the report design loaded from the specified filename.
static void writeReportToXmlFile(java.lang.String sourceFileName, java.lang.String destFileName)
          Generates the XML representation of the report design loaded from the first file parameter and place it in the file specified by the second parameter.
static void writeReportToXmlStream(java.io.InputStream inputStream, java.io.OutputStream outputStream)
          Generates the XML representation of the serialized report design object read from the supplied input stream abd writes it to the specified output stream, using the "UTF-8" encoding.
static void writeReportToXmlStream(JRReport report, java.io.OutputStream outputStream)
          Generates the XML representation of the report design object supplied as parameter and writes it to the specified output stream, using the "UTF-8" encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasperCompileManager

public JasperCompileManager()
Method Detail

compileReportToFile

public static java.lang.String compileReportToFile(java.lang.String sourceFileName)
                                            throws JRException
Compiles the XML report design file specified by the parameter. The result of this operation is another file that will contain the serialized JasperReport object representing the compiled report design, having the same name as the report design as declared in the XML plus the *.jasper extension, located in the same directory as the XML source file.

Parameters:
sourceFileName - XML source file name
Returns:
resulting file name containing a serialized JasperReport object
Throws:
JRException

compileReportToFile

public static void compileReportToFile(java.lang.String sourceFileName,
                                       java.lang.String destFileName)
                                throws JRException
Compiles the XML report design file received as the first parameter, placing the result in the file specified by the second parameter. The resulting file will contain a serialized instance of a JasperReport object representing the compiled report design.

Parameters:
sourceFileName - XML source file name
destFileName - file name to place the result into
Throws:
JRException

compileReportToFile

public static void compileReportToFile(JasperDesign jasperDesign,
                                       java.lang.String destFileName)
                                throws JRException
Compiles the report design object received as the first parameter, placing the result in the file specified by the second parameter. The resulting file will contain a serialized instance of a JasperReport object representing the compiled report design.

Parameters:
jasperDesign - source report design object
destFileName - file name to place the compiled report design into
Throws:
JRException

compileReport

public static JasperReport compileReport(java.lang.String sourceFileName)
                                  throws JRException
Compiles the XML report design file received as parameter, and returns the compiled report design object.

Parameters:
sourceFileName - XML source file name
Returns:
compiled report design object
Throws:
JRException

compileReportToStream

public static void compileReportToStream(java.io.InputStream inputStream,
                                         java.io.OutputStream outputStream)
                                  throws JRException
Compiles the XML representation of the report design read from the supplied input stream and writes the generated compiled report design object to the output stream specified by the second parameter.

Parameters:
inputStream - XML source input stream
outputStream - output stream to write the compiled report design to
Throws:
JRException

compileReportToStream

public static void compileReportToStream(JasperDesign jasperDesign,
                                         java.io.OutputStream outputStream)
                                  throws JRException
Compiles the report design object represented by the first parameter and writes the generated compiled report design object to the output stream specified by the second parameter.

Parameters:
jasperDesign - source report design object
outputStream - output stream to write the compiled report design to
Throws:
JRException

compileReport

public static JasperReport compileReport(java.io.InputStream inputStream)
                                  throws JRException
Compiles the serialized report design object read from the supplied input stream and returns the generated compiled report design object.

Parameters:
inputStream - XML source input stream
Returns:
compiled report design object
Throws:
JRException

compileReport

public static JasperReport compileReport(JasperDesign jasperDesign)
                                  throws JRException
Compiles the report design object received as parameter and returns the generated compiled report design object.

Parameters:
jasperDesign - source report design object
Returns:
compiled report design object
Throws:
JRException
See Also:
JRDefaultCompiler

verifyDesign

public static java.util.Collection verifyDesign(JasperDesign jasperDesign)
Verifies the validity and consistency of the report design object. Returns a collection of errors, if problems are found in the report design.

Parameters:
jasperDesign - report design object to verify
Returns:
collection of JRValidationFault if problems are found
See Also:
JRVerifier

loadEvaluator

public static JREvaluator loadEvaluator(JasperReport jasperReport,
                                        JRDataset dataset)
                                 throws JRException
Throws:
JRException

loadEvaluator

public static JREvaluator loadEvaluator(JasperReport jasperReport,
                                        JRCrosstab crosstab)
                                 throws JRException
Throws:
JRException

loadEvaluator

public static JREvaluator loadEvaluator(JasperReport jasperReport)
                                 throws JRException
Throws:
JRException

writeReportToXmlFile

public static java.lang.String writeReportToXmlFile(java.lang.String sourceFileName)
                                             throws JRException
Generates the XML representation of the report design loaded from the specified filename. The result of this operation is an "UTF-8" encoded XML file having the same name as the report design, plus the *.jasper.jrxml extension, located in the same directory as the source file.

Parameters:
sourceFileName - source file name containing the report design object
Returns:
XML representation of the report design
Throws:
JRException

writeReportToXmlFile

public static void writeReportToXmlFile(java.lang.String sourceFileName,
                                        java.lang.String destFileName)
                                 throws JRException
Generates the XML representation of the report design loaded from the first file parameter and place it in the file specified by the second parameter. The result is "UTF-8" encoded.

Parameters:
sourceFileName - source file name containing the report design object
destFileName - output file name to write the XML report design representation to
Throws:
JRException

writeReportToXmlFile

public static void writeReportToXmlFile(JRReport report,
                                        java.lang.String destFileName)
                                 throws JRException
Generates the XML representation of the report design supplied as the first parameter and place it in the file specified by the second parameter. The result is "UTF-8" encoded.

Parameters:
report - source report design object
destFileName - output file name to write the XML report design representation to
Throws:
JRException
See Also:
JRXmlWriter

writeReportToXmlStream

public static void writeReportToXmlStream(java.io.InputStream inputStream,
                                          java.io.OutputStream outputStream)
                                   throws JRException
Generates the XML representation of the serialized report design object read from the supplied input stream abd writes it to the specified output stream, using the "UTF-8" encoding.

Parameters:
inputStream - source input stream to read the report design object from
outputStream - output stream to write the XML report design representation to
Throws:
JRException

writeReportToXmlStream

public static void writeReportToXmlStream(JRReport report,
                                          java.io.OutputStream outputStream)
                                   throws JRException
Generates the XML representation of the report design object supplied as parameter and writes it to the specified output stream, using the "UTF-8" encoding.

Parameters:
report - source report design object
outputStream - output stream to write the XML report design representation to
Throws:
JRException
See Also:
JRXmlWriter

writeReportToXml

public static java.lang.String writeReportToXml(JRReport report)
Generates the XML representation of the report design object supplied as parameter using the "UTF-8" enconding.

Parameters:
report - source report design object
Returns:
XML representation of the report design
See Also:
JRXmlWriter


© 2001-2009 Jaspersoft Corporation www.jaspersoft.com