Package net.sf.jasperreports.engine
Class JasperRunManager
java.lang.Object
net.sf.jasperreports.engine.JasperRunManager
Facade class for the JasperReports engine.
Sometimes it is useful to produce documents only in a popular format such as PDF or
HTML, without having to store on disk the serialized, intermediate
JasperPrint object produced by the report-filling
process.
This can be achieved using this manager class, which immediately exports the document produced by the report-filling process into the desired output format.
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Method Summary
Modifier and TypeMethodDescriptionstatic JasperRunManagergetInstance(JasperReportsContext jasperReportsContext) static voidstatic voidrunReportToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) static voidrunReportToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) static StringrunReportToHtmlFile(String sourceFileName, Map<String, Object> params) static StringrunReportToHtmlFile(String sourceFileName, Map<String, Object> params, Connection conn) static StringrunReportToHtmlFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) static byte[]runReportToPdf(InputStream inputStream, Map<String, Object> parameters) static byte[]runReportToPdf(InputStream inputStream, Map<String, Object> parameters, Connection conn) static byte[]runReportToPdf(InputStream inputStream, Map<String, Object> parameters, JRDataSource jrDataSource) static byte[]runReportToPdf(String sourceFileName, Map<String, Object> parameters) static byte[]runReportToPdf(String sourceFileName, Map<String, Object> parameters, Connection conn) static byte[]runReportToPdf(String sourceFileName, Map<String, Object> parameters, JRDataSource jrDataSource) static byte[]runReportToPdf(JasperReport jasperReport, Map<String, Object> parameters) static byte[]runReportToPdf(JasperReport jasperReport, Map<String, Object> parameters, Connection conn) static byte[]runReportToPdf(JasperReport jasperReport, Map<String, Object> parameters, JRDataSource jrDataSource) static voidstatic voidrunReportToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) static voidrunReportToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) static StringrunReportToPdfFile(String sourceFileName, Map<String, Object> params) static StringrunReportToPdfFile(String sourceFileName, Map<String, Object> params, Connection conn) static StringrunReportToPdfFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) static voidrunReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters) static voidrunReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, Connection conn) static voidrunReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, JRDataSource jrDataSource) voidFills a report and saves it directly into a HTML file.voidrunToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) Fills a report and saves it directly into a HTML file.voidrunToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) Fills a report and saves it directly into a HTML file.runToHtmlFile(String sourceFileName, Map<String, Object> params) Fills a report and saves it directly into a HTML file.runToHtmlFile(String sourceFileName, Map<String, Object> params, Connection conn) Fills a report and saves it directly into a HTML file.runToHtmlFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) Fills a report and saves it directly into a HTML file.byte[]runToPdf(InputStream inputStream, Map<String, Object> parameters) Fills a report and returns byte array object containing the report in PDF format.byte[]runToPdf(InputStream inputStream, Map<String, Object> parameters, Connection conn) Fills a report and returns byte array object containing the report in PDF format.byte[]runToPdf(InputStream inputStream, Map<String, Object> parameters, JRDataSource jrDataSource) Fills a report and returns byte array object containing the report in PDF format.byte[]Fills a report and returns byte array object containing the report in PDF format.byte[]Fills a report and returns byte array object containing the report in PDF format.byte[]Fills a report and sends it to an output stream in PDF format.byte[]runToPdf(JasperReport jasperReport, Map<String, Object> parameters) Fills a report and returns byte array object containing the report in PDF format.byte[]runToPdf(JasperReport jasperReport, Map<String, Object> parameters, Connection conn) Fills a report and returns byte array object containing the report in PDF format.byte[]runToPdf(JasperReport jasperReport, Map<String, Object> parameters, JRDataSource jrDataSource) Fills a report and returns byte array object containing the report in PDF format.voidFills a report and saves it directly into a PDF file.voidrunToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) Fills a report and saves it directly into a PDF file.voidrunToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) Fills a report and saves it directly into a PDF file.runToPdfFile(String sourceFileName, Map<String, Object> params) Fills a report and saves it directly into a PDF file.runToPdfFile(String sourceFileName, Map<String, Object> params, Connection conn) Fills a report and saves it directly into a PDF file.runToPdfFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) Fills a report and saves it directly into a PDF file.voidrunToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters) Fills a report and sends it directly to an OutputStream in PDF format.voidrunToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, Connection conn) Fills a report and sends it directly to an OutputStream in PDF format.voidrunToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, JRDataSource jrDataSource) Fills a report and sends it directly to an OutputStream in PDF format.
-
Method Details
-
getInstance
-
runToPdfFile
public String runToPdfFile(String sourceFileName, Map<String, Object> params, Connection conn) throws JRExceptionFills a report and saves it directly into a PDF file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdfFile
Fills a report and saves it directly into a PDF file. The intermediate JasperPrint object is not saved on disk.- Parameters:
sourceFileName- the name of the compiled report fileparams- the parameters map- Returns:
- the name of the generated PDF file
- Throws:
JRException- See Also:
-
runToPdfFile
public void runToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) throws JRExceptionFills a report and saves it directly into a PDF file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdfFile
public void runToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters) throws JRExceptionFills a report and saves it directly into a PDF file. The intermediate JasperPrint object is not saved on disk.- Parameters:
sourceFileName- source file containing the compiled report designdestFileName- PDF destination file nameparameters- report parameters map- Throws:
JRException- See Also:
-
runToPdfStream
public void runToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, Connection conn) throws JRExceptionFills a report and sends it directly to an OutputStream in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdfStream
public void runToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters) throws JRExceptionFills a report and sends it directly to an OutputStream in PDF format. The intermediate JasperPrint object is not saved on disk.- Parameters:
inputStream- compiled report input streamoutputStream- PDF output streamparameters- parameters map- Throws:
JRException- See Also:
-
runToPdf
public byte[] runToPdf(String sourceFileName, Map<String, Object> parameters, Connection conn) throws JRExceptionFills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdf
Fills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Parameters:
sourceFileName- source file containing the compiled report designparameters- report parameters map- Returns:
- binary PDF output
- Throws:
JRException- See Also:
-
runToPdf
public byte[] runToPdf(InputStream inputStream, Map<String, Object> parameters, Connection conn) throws JRExceptionFills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdf
Fills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Parameters:
inputStream- input stream to read the compiled report design object fromparameters- report parameters map- Returns:
- binary PDF output
- Throws:
JRException- See Also:
-
runToPdf
public byte[] runToPdf(JasperReport jasperReport, Map<String, Object> parameters, Connection conn) throws JRExceptionFills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdf
Fills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Parameters:
jasperReport- the compiled reportparameters- the parameters map- Returns:
- binary PDF output
- Throws:
JRException- See Also:
-
runToPdfFile
public String runToPdfFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) throws JRExceptionFills a report and saves it directly into a PDF file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdfFile
public void runToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRExceptionFills a report and saves it directly into a PDF file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdfStream
public void runToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRExceptionFills a report and sends it directly to an OutputStream in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdf
public byte[] runToPdf(String sourceFileName, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRExceptionFills a report and sends it to an output stream in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdf
public byte[] runToPdf(InputStream inputStream, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRExceptionFills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdf
public byte[] runToPdf(JasperReport jasperReport, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRExceptionFills a report and returns byte array object containing the report in PDF format. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToHtmlFile
public String runToHtmlFile(String sourceFileName, Map<String, Object> params, Connection conn) throws JRExceptionFills a report and saves it directly into a HTML file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToHtmlFile
Fills a report and saves it directly into a HTML file. The intermediate JasperPrint object is not saved on disk.- Parameters:
sourceFileName- the name of the compiled report fileparams- the parameters map- Returns:
- the name of the generated HTML file
- Throws:
JRException- See Also:
-
runToHtmlFile
public void runToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) throws JRExceptionFills a report and saves it directly into a HTML file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToHtmlFile
public void runToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters) throws JRExceptionFills a report and saves it directly into a HTML file. The intermediate JasperPrint object is not saved on disk.- Parameters:
sourceFileName- source file containing the compiled report designdestFileName- name of the destination HTML fileparameters- report parameters map- Throws:
JRException- See Also:
-
runToHtmlFile
public String runToHtmlFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) throws JRExceptionFills a report and saves it directly into a HTML file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToHtmlFile
public void runToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRExceptionFills a report and saves it directly into a HTML file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runReportToPdfFile
public static String runReportToPdfFile(String sourceFileName, Map<String, Object> params, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfFile
public static String runReportToPdfFile(String sourceFileName, Map<String, Object> params) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfFile
public static void runReportToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfFile
public static void runReportToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfStream
public static void runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfStream
public static void runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(String sourceFileName, Map<String, Object> parameters, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(String sourceFileName, Map<String, Object> parameters) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(InputStream inputStream, Map<String, Object> parameters, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(InputStream inputStream, Map<String, Object> parameters) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(JasperReport jasperReport, Map<String, Object> parameters, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(JasperReport jasperReport, Map<String, Object> parameters) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfFile
public static String runReportToPdfFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfFile
public static void runReportToPdfFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-
runReportToPdfStream
public static void runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(String sourceFileName, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(InputStream inputStream, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-
runReportToPdf
public static byte[] runReportToPdf(JasperReport jasperReport, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-
runReportToHtmlFile
public static String runReportToHtmlFile(String sourceFileName, Map<String, Object> params, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToHtmlFile
public static String runReportToHtmlFile(String sourceFileName, Map<String, Object> params) throws JRException- Throws:
JRException- See Also:
-
runReportToHtmlFile
public static void runReportToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, Connection conn) throws JRException- Throws:
JRException- See Also:
-
runReportToHtmlFile
public static void runReportToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters) throws JRException- Throws:
JRException- See Also:
-
runReportToHtmlFile
public static String runReportToHtmlFile(String sourceFileName, Map<String, Object> params, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-
runReportToHtmlFile
public static void runReportToHtmlFile(String sourceFileName, String destFileName, Map<String, Object> parameters, JRDataSource jrDataSource) throws JRException- Throws:
JRException- See Also:
-