Package net.sf.jasperreports.engine
Class JasperRunManager
- java.lang.Object
-
- net.sf.jasperreports.engine.JasperRunManager
-
public final class JasperRunManager extends Object
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
JasperPrintobject 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JasperRunManagergetInstance(JasperReportsContext jasperReportsContext)static voidrunReportToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters)static 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 voidrunReportToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters)static 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)voidrunToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters)Fills 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.StringrunToHtmlFile(String sourceFileName, Map<String,Object> params)Fills a report and saves it directly into a HTML file.StringrunToHtmlFile(String sourceFileName, Map<String,Object> params, Connection conn)Fills a report and saves it directly into a HTML file.StringrunToHtmlFile(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[]runToPdf(String sourceFileName, Map<String,Object> parameters)Fills a report and returns byte array object containing the report in PDF format.byte[]runToPdf(String sourceFileName, Map<String,Object> parameters, Connection conn)Fills a report and returns byte array object containing the report in PDF format.byte[]runToPdf(String sourceFileName, Map<String,Object> parameters, JRDataSource jrDataSource)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.voidrunToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters)Fills 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.StringrunToPdfFile(String sourceFileName, Map<String,Object> params)Fills a report and saves it directly into a PDF file.StringrunToPdfFile(String sourceFileName, Map<String,Object> params, Connection conn)Fills a report and saves it directly into a PDF file.StringrunToPdfFile(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 Detail
-
getInstance
public static JasperRunManager getInstance(JasperReportsContext jasperReportsContext)
-
runToPdfFile
public String runToPdfFile(String sourceFileName, Map<String,Object> params, Connection conn) throws JRException
Fills a report and saves it directly into a PDF file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToPdfFile
public String runToPdfFile(String sourceFileName, Map<String,Object> params) throws JRException
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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToPdfFile
public void runToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn) throws JRException
Fills 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 JRException
Fills 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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToPdfStream
public void runToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters, Connection conn) throws JRException
Fills 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 JRException
Fills 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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToPdf
public byte[] runToPdf(String sourceFileName, Map<String,Object> parameters, Connection conn) throws JRException
Fills 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(String sourceFileName, Map<String,Object> parameters) throws JRException
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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToPdf
public byte[] runToPdf(InputStream inputStream, Map<String,Object> parameters, Connection conn) throws JRException
Fills 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(InputStream inputStream, Map<String,Object> parameters) throws JRException
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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToPdf
public byte[] runToPdf(JasperReport jasperReport, Map<String,Object> parameters, Connection conn) throws JRException
Fills 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) throws JRException
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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToPdfFile
public String runToPdfFile(String sourceFileName, Map<String,Object> params, JRDataSource jrDataSource) throws JRException
Fills 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 JRException
Fills 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 JRException
Fills 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 JRException
Fills 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 JRException
Fills 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 JRException
Fills 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 JRException
Fills a report and saves it directly into a HTML file. The intermediate JasperPrint object is not saved on disk.- Throws:
JRException
-
runToHtmlFile
public String runToHtmlFile(String sourceFileName, Map<String,Object> params) throws JRException
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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToHtmlFile
public void runToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn) throws JRException
Fills 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 JRException
Fills 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:
JRFiller.fill(JasperReportsContext, JasperReport, Map)
-
runToHtmlFile
public String runToHtmlFile(String sourceFileName, Map<String,Object> params, JRDataSource jrDataSource) throws JRException
Fills 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 JRException
Fills 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:
runToPdfFile(String, Map, Connection)
-
runReportToPdfFile
public static String runReportToPdfFile(String sourceFileName, Map<String,Object> params) throws JRException
- Throws:
JRException- See Also:
runToPdfFile(String, Map)
-
runReportToPdfFile
public static void runReportToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException- See Also:
runToPdfFile(String, String, Map, Connection)
-
runReportToPdfFile
public static void runReportToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters) throws JRException
- Throws:
JRException- See Also:
runToPdfFile(String, String, Map)
-
runReportToPdfStream
public static void runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException- See Also:
runToPdfStream(InputStream, OutputStream, Map, Connection)
-
runReportToPdfStream
public static void runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters) throws JRException
- Throws:
JRException- See Also:
runToPdfStream(InputStream, OutputStream, Map)
-
runReportToPdf
public static byte[] runReportToPdf(String sourceFileName, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException- See Also:
runToPdf(String, Map, Connection)
-
runReportToPdf
public static byte[] runReportToPdf(String sourceFileName, Map<String,Object> parameters) throws JRException
- Throws:
JRException- See Also:
runToPdf(String, Map)
-
runReportToPdf
public static byte[] runReportToPdf(InputStream inputStream, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException- See Also:
runToPdf(InputStream, Map, Connection)
-
runReportToPdf
public static byte[] runReportToPdf(InputStream inputStream, Map<String,Object> parameters) throws JRException
- Throws:
JRException- See Also:
runToPdf(InputStream, Map)
-
runReportToPdf
public static byte[] runReportToPdf(JasperReport jasperReport, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException- See Also:
runToPdf(JasperReport, Map, Connection)
-
runReportToPdf
public static byte[] runReportToPdf(JasperReport jasperReport, Map<String,Object> parameters) throws JRException
- Throws:
JRException- See Also:
runToPdf(JasperReport, Map)
-
runReportToPdfFile
public static String runReportToPdfFile(String sourceFileName, Map<String,Object> params, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToPdfFile(String, Map, JRDataSource)
-
runReportToPdfFile
public static void runReportToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToPdfFile(String, String, Map, JRDataSource)
-
runReportToPdfStream
public static void runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToPdfStream(InputStream, OutputStream, Map, JRDataSource)
-
runReportToPdf
public static byte[] runReportToPdf(String sourceFileName, Map<String,Object> parameters, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToPdf(String, Map, JRDataSource)
-
runReportToPdf
public static byte[] runReportToPdf(InputStream inputStream, Map<String,Object> parameters, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToPdf(InputStream, Map, JRDataSource)
-
runReportToPdf
public static byte[] runReportToPdf(JasperReport jasperReport, Map<String,Object> parameters, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToPdf(JasperReport, Map, JRDataSource)
-
runReportToHtmlFile
public static String runReportToHtmlFile(String sourceFileName, Map<String,Object> params, Connection conn) throws JRException
- Throws:
JRException- See Also:
runToHtmlFile(String, Map, Connection)
-
runReportToHtmlFile
public static String runReportToHtmlFile(String sourceFileName, Map<String,Object> params) throws JRException
- Throws:
JRException- See Also:
runToHtmlFile(String, Map)
-
runReportToHtmlFile
public static void runReportToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn) throws JRException
- Throws:
JRException- See Also:
runToHtmlFile(String, String, Map, Connection)
-
runReportToHtmlFile
public static void runReportToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters) throws JRException
- Throws:
JRException- See Also:
runToHtmlFile(String, String, Map)
-
runReportToHtmlFile
public static String runReportToHtmlFile(String sourceFileName, Map<String,Object> params, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToHtmlFile(String, Map, JRDataSource)
-
runReportToHtmlFile
public static void runReportToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters, JRDataSource jrDataSource) throws JRException
- Throws:
JRException- See Also:
runToHtmlFile(String, String, Map, JRDataSource)
-
-