|
static void | writeAsResponse (HttpServletResponse response, String jasperFile, Collection collection, Map parameters) |
|
static void | exportToStream (OutputStream out, String jasperFile, Collection collection, Map parameters) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 42 of file GeneratePDF.java.
◆ exportToStream()
static void org.turro.pdf.GeneratePDF.exportToStream |
( |
OutputStream |
out, |
|
|
String |
jasperFile, |
|
|
Collection |
collection, |
|
|
Map |
parameters |
|
) |
| |
|
static |
Definition at line 67 of file GeneratePDF.java.
69 JRDataSource dataSource =
new JRBeanCollectionDataSource(collection);
70 JasperPrint jasperPrint = JasperFillManager.fillReport(jasperFile, parameters, dataSource);
71 JasperExportManager.exportReportToPdfStream(jasperPrint, out);
72 }
catch (JRException ex) {
73 Logger.getLogger(GeneratePDF.class.getName()).log(Level.SEVERE,
null, ex);
◆ writeAsResponse()
static void org.turro.pdf.GeneratePDF.writeAsResponse |
( |
HttpServletResponse |
response, |
|
|
String |
jasperFile, |
|
|
Collection |
collection, |
|
|
Map |
parameters |
|
) |
| |
|
static |
Definition at line 44 of file GeneratePDF.java.
45 ServletOutputStream output =
null;
47 response.setContentType(
"application/pdf");
48 response.setHeader(
"pragma",
"no-cache");
49 response.setHeader(
"Cache-control",
"no-cache, no-store, must-revalidate");
50 response.setHeader(
"Expires",
"01 Apr 1995 01:10:10 GMT");
51 response.setHeader(
"Content-Disposition",
"filename=" + FileUtil.getBaseName(
new File(jasperFile)) +
".pdf" );
53 output = response.getOutputStream();
56 }
catch (IOException ex) {
57 Logger.getLogger(GeneratePDF.class.getName()).log(Level.SEVERE,
null, ex);
61 }
catch (IOException ex) {
62 Logger.getLogger(GeneratePDF.class.getName()).log(Level.SEVERE,
null, ex);
static void exportToStream(OutputStream out, String jasperFile, Collection collection, Map parameters)
The documentation for this class was generated from the following file: