public final class JasperExportManager extends Object
This class contains convenience methods for exporting to only these 3 formats. These methods can process data that comes from different sources and goes to different destinations (files, input and output streams, etc.).
For exporting to XLS and CSV format or for using special exporter parameters, the specific exporter class should be used directly.
JasperPrint,
HtmlExporter,
JRPdfExporter,
JRXmlExporter,
JRXlsExporter,
JRCsvExporter| Modifier and Type | Method and Description |
|---|---|
static void |
exportReportToHtmlFile(JasperPrint jasperPrint,
String destFileName) |
static String |
exportReportToHtmlFile(String sourceFileName) |
static void |
exportReportToHtmlFile(String sourceFileName,
String destFileName) |
static byte[] |
exportReportToPdf(JasperPrint jasperPrint) |
static void |
exportReportToPdfFile(JasperPrint jasperPrint,
String destFileName) |
static String |
exportReportToPdfFile(String sourceFileName) |
static void |
exportReportToPdfFile(String sourceFileName,
String destFileName) |
static void |
exportReportToPdfStream(InputStream inputStream,
OutputStream outputStream) |
static void |
exportReportToPdfStream(JasperPrint jasperPrint,
OutputStream outputStream)
Exports the generated report object received as first parameter into PDF format and
writes the results to the output stream specified by the second parameter.
|
static String |
exportReportToXml(JasperPrint jasperPrint) |
static void |
exportReportToXmlFile(JasperPrint jasperPrint,
String destFileName,
boolean isEmbeddingImages) |
static String |
exportReportToXmlFile(String sourceFileName,
boolean isEmbeddingImages) |
static void |
exportReportToXmlFile(String sourceFileName,
String destFileName,
boolean isEmbeddingImages) |
static void |
exportReportToXmlStream(InputStream inputStream,
OutputStream outputStream) |
static void |
exportReportToXmlStream(JasperPrint jasperPrint,
OutputStream outputStream) |
void |
exportToHtmlFile(JasperPrint jasperPrint,
String destFileName)
Exports the generated report object received as parameter into HTML format,
placing the result into the second file parameter.
|
String |
exportToHtmlFile(String sourceFileName)
Exports the generated report file specified by the parameter into HTML format.
|
void |
exportToHtmlFile(String sourceFileName,
String destFileName)
Exports the generated report file specified by the first parameter into HTML format,
placing the result into the second file parameter.
|
byte[] |
exportToPdf(JasperPrint jasperPrint)
Exports the generated report object received as parameter into PDF format and
returns the binary content as a byte array.
|
void |
exportToPdfFile(JasperPrint jasperPrint,
String destFileName)
Exports the generated report file specified by the first parameter into PDF format,
the result being placed in the second file parameter.
|
String |
exportToPdfFile(String sourceFileName)
Exports the generated report file specified by the parameter into PDF format.
|
void |
exportToPdfFile(String sourceFileName,
String destFileName)
Exports the generated report file specified by the first parameter into PDF format,
the result being placed in the second file parameter.
|
void |
exportToPdfStream(InputStream inputStream,
OutputStream outputStream)
Exports the generated report read from the supplied input stream into PDF format and
writes the results to the output stream specified by the second parameter.
|
void |
exportToPdfStream(JasperPrint jasperPrint,
OutputStream outputStream)
Exports the generated report object received as first parameter into PDF format and
writes the results to the output stream specified by the second parameter.
|
String |
exportToXml(JasperPrint jasperPrint)
Exports the generated report object supplied as parameter into XML format
and returs the result as String.
|
void |
exportToXmlFile(JasperPrint jasperPrint,
String destFileName,
boolean isEmbeddingImages)
Exports the generated report object received as parameter into XML format,
placing the result into the second file parameter.
|
String |
exportToXmlFile(String sourceFileName,
boolean isEmbeddingImages)
Exports the generated report file specified by the parameter into XML format.
|
void |
exportToXmlFile(String sourceFileName,
String destFileName,
boolean isEmbeddingImages)
Exports the generated report file specified by the first parameter into XML format,
placing the result into the second file parameter.
|
void |
exportToXmlStream(InputStream inputStream,
OutputStream outputStream)
Exports the generated report object read from the supplied input stream into XML format,
and writes the result to the output stream specified by the second parameter.
|
void |
exportToXmlStream(JasperPrint jasperPrint,
OutputStream outputStream)
Exports the generated report object supplied as the first parameter into XML format,
and writes the result to the output stream specified by the second parameter.
|
static JasperExportManager |
getInstance(JasperReportsContext jasperReportsContext) |
public static JasperExportManager getInstance(JasperReportsContext jasperReportsContext)
public String exportToPdfFile(String sourceFileName) throws JRException
*.pdf extension and it is located in the same directory as the source file.sourceFileName - source file containing the generated reportJRExceptionJRPdfExporterpublic void exportToPdfFile(String sourceFileName, String destFileName) throws JRException
sourceFileName - source file containing the generated reportdestFileName - file name to place the PDF content intoJRExceptionJRPdfExporterpublic void exportToPdfFile(JasperPrint jasperPrint, String destFileName) throws JRException
jasperPrint - report object to exportdestFileName - file name to place the PDF content intoJRExceptionJRPdfExporterpublic void exportToPdfStream(InputStream inputStream, OutputStream outputStream) throws JRException
inputStream - input stream to read the generated report object fromoutputStream - output stream to write the resulting PDF content toJRExceptionJRPdfExporterpublic void exportToPdfStream(JasperPrint jasperPrint, OutputStream outputStream) throws JRException
jasperPrint - report object to exportoutputStream - output stream to write the resulting PDF content toJRExceptionJRPdfExporterpublic byte[] exportToPdf(JasperPrint jasperPrint) throws JRException
jasperPrint - report object to exportJRExceptionJRPdfExporterpublic String exportToXmlFile(String sourceFileName, boolean isEmbeddingImages) throws JRException
*.jrpxml extension and it is located in the same directory as the source file.
When exporting to XML format, the images can be either embedded in the XML content itself using the Base64 encoder or be referenced as external resources. If not embedded, the images are placed as distinct files inside a directory having the same name as the XML destination file, plus the "_files" suffix.
sourceFileName - source file containing the generated reportisEmbeddingImages - flag that indicates whether the images should be embedded in the
XML content itself using the Base64 encoder or be referenced as external resourcesJRExceptionJRPdfExporterpublic void exportToXmlFile(String sourceFileName, String destFileName, boolean isEmbeddingImages) throws JRException
If not embedded into the XML content itself using the Base64 encoder, the images are placed as distinct files inside a directory having the same name as the XML destination file, plus the "_files" suffix.
sourceFileName - source file containing the generated reportdestFileName - file name to place the XML representation intoisEmbeddingImages - flag that indicates whether the images should be embedded in the
XML content itself using the Base64 encoder or be referenced as external resourcesJRExceptionJRPdfExporterpublic void exportToXmlFile(JasperPrint jasperPrint, String destFileName, boolean isEmbeddingImages) throws JRException
If not embedded into the XML content itself using the Base64 encoder, the images are placed as distinct files inside a directory having the same name as the XML destination file, plus the "_files" suffix.
jasperPrint - report object to exportdestFileName - file name to place the XML representation intoisEmbeddingImages - flag that indicates whether the images should be embedded in the
XML content itself using the Base64 encoder or be referenced as external resourcesJRExceptionJRPdfExporterpublic void exportToXmlStream(InputStream inputStream, OutputStream outputStream) throws JRException
inputStream - input stream to read the generated report object fromoutputStream - output stream to write the resulting XML representation toJRExceptionJRPdfExporterpublic void exportToXmlStream(JasperPrint jasperPrint, OutputStream outputStream) throws JRException
jasperPrint - report object to exportoutputStream - output stream to write the resulting XML representation toJRExceptionJRPdfExporterpublic String exportToXml(JasperPrint jasperPrint) throws JRException
jasperPrint - report object to exportJRExceptionJRPdfExporterpublic String exportToHtmlFile(String sourceFileName) throws JRException
*.html extension and it is located in the same directory as the source file.
The images are placed as distinct files inside a directory having the same name
as the HTML destination file, plus the "_files" suffix.sourceFileName - source file containing the generated reportJRExceptionHtmlExporterpublic void exportToHtmlFile(String sourceFileName, String destFileName) throws JRException
The images are placed as distinct files inside a directory having the same name as the HTML destination file, plus the "_files" suffix.
sourceFileName - source file containing the generated reportdestFileName - file name to place the HTML content intoJRExceptionJRPdfExporterpublic void exportToHtmlFile(JasperPrint jasperPrint, String destFileName) throws JRException
The images are placed as distinct files inside a directory having the same name as the HTML destination file, plus the "_files" suffix.
jasperPrint - report object to exportdestFileName - file name to place the HTML content intoJRExceptionJRPdfExporterpublic static String exportReportToPdfFile(String sourceFileName) throws JRException
JRExceptionexportToPdfFile(String)public static void exportReportToPdfFile(String sourceFileName, String destFileName) throws JRException
JRExceptionexportToPdfFile(String, String)public static void exportReportToPdfFile(JasperPrint jasperPrint, String destFileName) throws JRException
JRExceptionexportToPdfFile(JasperPrint, String)public static void exportReportToPdfStream(InputStream inputStream, OutputStream outputStream) throws JRException
JRExceptionexportToPdfStream(InputStream, OutputStream)public static void exportReportToPdfStream(JasperPrint jasperPrint, OutputStream outputStream) throws JRException
jasperPrint - report object to exportoutputStream - output stream to write the resulting PDF content toJRExceptionJRPdfExporter,
exportToPdfStream(JasperPrint, OutputStream)public static byte[] exportReportToPdf(JasperPrint jasperPrint) throws JRException
JRExceptionexportToPdf(JasperPrint)public static String exportReportToXmlFile(String sourceFileName, boolean isEmbeddingImages) throws JRException
JRExceptionexportToXmlFile(String, String, boolean)public static void exportReportToXmlFile(String sourceFileName, String destFileName, boolean isEmbeddingImages) throws JRException
JRExceptionexportToXmlFile(String, String, boolean)public static void exportReportToXmlFile(JasperPrint jasperPrint, String destFileName, boolean isEmbeddingImages) throws JRException
JRExceptionexportToXmlFile(JasperPrint, String, boolean)public static void exportReportToXmlStream(InputStream inputStream, OutputStream outputStream) throws JRException
JRExceptionexportToXmlStream(InputStream, OutputStream)public static void exportReportToXmlStream(JasperPrint jasperPrint, OutputStream outputStream) throws JRException
JRExceptionexportToXmlStream(JasperPrint, OutputStream)public static String exportReportToXml(JasperPrint jasperPrint) throws JRException
JRExceptionexportToXml(JasperPrint)public static String exportReportToHtmlFile(String sourceFileName) throws JRException
JRExceptionexportToHtmlFile(String)public static void exportReportToHtmlFile(String sourceFileName, String destFileName) throws JRException
JRExceptionexportToHtmlFile(String, String)public static void exportReportToHtmlFile(JasperPrint jasperPrint, String destFileName) throws JRException
JRExceptionexportToHtmlFile(JasperPrint, String)Copyright © 2017. All rights reserved.