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
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JasperRunManager
getInstance(JasperReportsContext jasperReportsContext)
static void
runReportToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters)
static void
runReportToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn)
static void
runReportToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters, JRDataSource jrDataSource)
static String
runReportToHtmlFile(String sourceFileName, Map<String,Object> params)
static String
runReportToHtmlFile(String sourceFileName, Map<String,Object> params, Connection conn)
static String
runReportToHtmlFile(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 void
runReportToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters)
static void
runReportToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn)
static void
runReportToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters, JRDataSource jrDataSource)
static String
runReportToPdfFile(String sourceFileName, Map<String,Object> params)
static String
runReportToPdfFile(String sourceFileName, Map<String,Object> params, Connection conn)
static String
runReportToPdfFile(String sourceFileName, Map<String,Object> params, JRDataSource jrDataSource)
static void
runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters)
static void
runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters, Connection conn)
static void
runReportToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters, JRDataSource jrDataSource)
void
runToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters)
Fills a report and saves it directly into a HTML file.void
runToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn)
Fills a report and saves it directly into a HTML file.void
runToHtmlFile(String sourceFileName, String destFileName, Map<String,Object> parameters, JRDataSource jrDataSource)
Fills a report and saves it directly into a HTML file.String
runToHtmlFile(String sourceFileName, Map<String,Object> params)
Fills a report and saves it directly into a HTML file.String
runToHtmlFile(String sourceFileName, Map<String,Object> params, Connection conn)
Fills a report and saves it directly into a HTML file.String
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[]
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.void
runToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters)
Fills a report and saves it directly into a PDF file.void
runToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters, Connection conn)
Fills a report and saves it directly into a PDF file.void
runToPdfFile(String sourceFileName, String destFileName, Map<String,Object> parameters, JRDataSource jrDataSource)
Fills a report and saves it directly into a PDF file.String
runToPdfFile(String sourceFileName, Map<String,Object> params)
Fills a report and saves it directly into a PDF file.String
runToPdfFile(String sourceFileName, Map<String,Object> params, Connection conn)
Fills a report and saves it directly into a PDF file.String
runToPdfFile(String sourceFileName, Map<String,Object> params, JRDataSource jrDataSource)
Fills a report and saves it directly into a PDF file.void
runToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters)
Fills a report and sends it directly to an OutputStream in PDF format.void
runToPdfStream(InputStream inputStream, OutputStream outputStream, Map<String,Object> parameters, Connection conn)
Fills a report and sends it directly to an OutputStream in PDF format.void
runToPdfStream(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)
-
-