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
.
| Method from net.sf.jasperreports.engine.JasperCompileManager Detail: |
public static JasperReport compileReport(String sourceFileName) throws JRException {
JasperDesign jasperDesign = JRXmlLoader.load(sourceFileName);
return compileReport(jasperDesign);
}
Compiles the XML report design file received as parameter, and returns
the compiled report design object. |
public static JasperReport compileReport(InputStream inputStream) throws JRException {
JasperDesign jasperDesign = JRXmlLoader.load(inputStream);
return compileReport(jasperDesign);
}
Compiles the serialized report design object read from the supplied input stream and
returns the generated compiled report design object. |
public static JasperReport compileReport(JasperDesign jasperDesign) throws JRException {
return getCompiler(jasperDesign).compileReport(jasperDesign);
}
Compiles the report design object received as parameter and
returns the generated compiled report design object. |
public static String compileReportToFile(String sourceFileName) throws JRException {
File sourceFile = new File(sourceFileName);
JasperDesign jasperDesign = JRXmlLoader.load(sourceFileName);
File destFile = new File(sourceFile.getParent(), jasperDesign.getName() + ".jasper");
String destFileName = destFile.toString();
compileReportToFile(jasperDesign, destFileName);
return destFileName;
}
Compiles the XML report design file specified by the parameter.
The result of this operation is another file that will contain the serialized
net.sf.jasperreports.engine.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. |
public static void compileReportToFile(String sourceFileName,
String destFileName) throws JRException {
JasperDesign jasperDesign = JRXmlLoader.load(sourceFileName);
compileReportToFile(jasperDesign, destFileName);
}
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
net.sf.jasperreports.engine.JasperReport object representing
the compiled report design. |
public static void compileReportToFile(JasperDesign jasperDesign,
String destFileName) throws JRException {
JasperReport jasperReport = compileReport(jasperDesign);
JRSaver.saveObject(jasperReport, destFileName);
}
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
net.sf.jasperreports.engine.JasperReport object representing the compiled report design. |
public static void compileReportToStream(InputStream inputStream,
OutputStream outputStream) throws JRException {
JasperDesign jasperDesign = JRXmlLoader.load(inputStream);
compileReportToStream(jasperDesign, 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. |
public static void compileReportToStream(JasperDesign jasperDesign,
OutputStream outputStream) throws JRException {
JasperReport jasperReport = compileReport(jasperDesign);
JRSaver.saveObject(jasperReport, 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. |
public static JREvaluator loadEvaluator(JasperReport jasperReport) throws JRException {
return loadEvaluator(jasperReport, jasperReport.getMainDataset());
}
|
public static JREvaluator loadEvaluator(JasperReport jasperReport,
JRDataset dataset) throws JRException {
JRCompiler compiler = getCompiler(jasperReport);
return compiler.loadEvaluator(jasperReport, dataset);
}
|
public static JREvaluator loadEvaluator(JasperReport jasperReport,
JRCrosstab crosstab) throws JRException {
JRCompiler compiler = getCompiler(jasperReport);
return compiler.loadEvaluator(jasperReport, crosstab);
}
|
public static Collection verifyDesign(JasperDesign jasperDesign) {
return JRVerifier.verifyDesign(jasperDesign);
}
Verifies the validity and consistency of the report design object.
Returns a collection of errors , if problems are found in the report design. |
public static String writeReportToXml(JRReport report) {
return JRXmlWriter.writeReport(report, "UTF-8");
}
Generates the XML representation of the report design object supplied as parameter
using the "UTF-8" enconding. |
public static String writeReportToXmlFile(String sourceFileName) throws JRException {
File sourceFile = new File(sourceFileName);
/* We need the report name. */
JRReport report = (JRReport)JRLoader.loadObject(sourceFile);
File destFile = new File(sourceFile.getParent(), report.getName() + ".jasper.jrxml");
String destFileName = destFile.toString();
writeReportToXmlFile(
report,
destFileName
);
return destFileName;
}
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. |
public static void writeReportToXmlFile(String sourceFileName,
String destFileName) throws JRException {
JRReport report = (JRReport)JRLoader.loadObject(sourceFileName);
writeReportToXmlFile(
report,
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. The result is "UTF-8" encoded. |
public static void writeReportToXmlFile(JRReport report,
String destFileName) throws JRException {
JRXmlWriter.writeReport(
report,
destFileName,
"UTF-8"
);
}
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. |
public static void writeReportToXmlStream(InputStream inputStream,
OutputStream outputStream) throws JRException {
JRReport report = (JRReport)JRLoader.loadObject(inputStream);
writeReportToXmlStream(report, 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. |
public static void writeReportToXmlStream(JRReport report,
OutputStream outputStream) throws JRException {
JRXmlWriter.writeReport(
report,
outputStream,
"UTF-8"
);
}
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. |