|
static void | print (String title, Collection collection, Map parameters, String jasperFile, String defaultFile, String type, String certificateStore) throws JRException |
|
static void | print (String title, JRDataSource dataSource, Map parameters, String jasperFile, String defaultFile, String type, String certificateStore) throws JRException |
|
static void | send (String title, Collection collection, Map parameters, String jasperFile, String defaultFile, String type, String certificateStore, Collection< IContact > contacts, String comment, Collection< MailAttachment > attachments, Consumer onFinish) throws JRException |
|
static void | send (String title, JRDataSource dataSource, Map parameters, String jasperFile, String defaultFile, String type, String certificateStore, Collection< IContact > contacts, String comment, Collection< MailAttachment > attachments, Consumer onFinish) throws JRException |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 44 of file ReportPrint.java.
◆ ReportPrint() [1/2]
org.turro.zkoss.print.ReportPrint.ReportPrint |
( |
| ) |
throws InterruptedException |
◆ ReportPrint() [2/2]
org.turro.zkoss.print.ReportPrint.ReportPrint |
( |
String |
title, |
|
|
String |
border, |
|
|
boolean |
closable |
|
) |
| throws InterruptedException |
◆ getReport()
Jasperreport org.turro.zkoss.print.ReportPrint.getReport |
( |
| ) |
|
◆ print() [1/2]
static void org.turro.zkoss.print.ReportPrint.print |
( |
String |
title, |
|
|
Collection |
collection, |
|
|
Map |
parameters, |
|
|
String |
jasperFile, |
|
|
String |
defaultFile, |
|
|
String |
type, |
|
|
String |
certificateStore |
|
) |
| throws JRException |
|
static |
Definition at line 64 of file ReportPrint.java.
66 print(title,
new JRBeanCollectionDataSource(collection), parameters, jasperFile, defaultFile, type, certificateStore);
static void print(String title, Collection collection, Map parameters, String jasperFile, String defaultFile, String type, String certificateStore)
◆ print() [2/2]
static void org.turro.zkoss.print.ReportPrint.print |
( |
String |
title, |
|
|
JRDataSource |
dataSource, |
|
|
Map |
parameters, |
|
|
String |
jasperFile, |
|
|
String |
defaultFile, |
|
|
String |
type, |
|
|
String |
certificateStore |
|
) |
| throws JRException |
|
static |
Definition at line 69 of file ReportPrint.java.
72 reportView.setTitle(title);
73 if(reportView.getReport() instanceof SignedReport) {
74 ((SignedReport) reportView.getReport()).setCertificateStore(certificateStore);
76 if (
new File(ElephantContext.getRealPath(jasperFile)).exists()) {
77 reportView.getReport().setSrc(jasperFile);
79 reportView.getReport().setSrc(defaultFile);
81 reportView.getReport().setParameters(parameters);
82 reportView.getReport().setDatasource(dataSource);
83 reportView.getReport().setType(type);
84 Modal.doModal(reportView,
null);
◆ send() [1/2]
static void org.turro.zkoss.print.ReportPrint.send |
( |
String |
title, |
|
|
Collection |
collection, |
|
|
Map |
parameters, |
|
|
String |
jasperFile, |
|
|
String |
defaultFile, |
|
|
String |
type, |
|
|
String |
certificateStore, |
|
|
Collection< IContact > |
contacts, |
|
|
String |
comment, |
|
|
Collection< MailAttachment > |
attachments, |
|
|
Consumer |
onFinish |
|
) |
| throws JRException |
|
static |
Definition at line 87 of file ReportPrint.java.
90 send(title,
new JRBeanCollectionDataSource(collection), parameters, jasperFile, defaultFile,
91 type, certificateStore, contacts, comment, attachments, onFinish);
static void send(String title, Collection collection, Map parameters, String jasperFile, String defaultFile, String type, String certificateStore, Collection< IContact > contacts, String comment, Collection< MailAttachment > attachments, Consumer onFinish)
◆ send() [2/2]
static void org.turro.zkoss.print.ReportPrint.send |
( |
String |
title, |
|
|
JRDataSource |
dataSource, |
|
|
Map |
parameters, |
|
|
String |
jasperFile, |
|
|
String |
defaultFile, |
|
|
String |
type, |
|
|
String |
certificateStore, |
|
|
Collection< IContact > |
contacts, |
|
|
String |
comment, |
|
|
Collection< MailAttachment > |
attachments, |
|
|
Consumer |
onFinish |
|
) |
| throws JRException |
|
static |
Definition at line 94 of file ReportPrint.java.
98 if(contacts ==
null)
return;
99 Application app = Application.getApplication();
100 SignedReport sr =
new SignedReport();
101 sr.setCertificateStore(certificateStore);
102 if(
new File(ElephantContext.getRealPath(jasperFile)).exists()) {
103 sr.setSrc(jasperFile);
105 sr.setSrc(defaultFile);
107 sr.setParameters(parameters);
108 sr.setDatasource(dataSource);
110 File attach = File.createTempFile(
"attach_",
"_mail");
111 FileOutputStream fos =
new FileOutputStream(attach);
112 InputStream is = sr.getReport().getStreamData();
114 byte[] bytes =
new byte[1024];
115 while ((read = is.read(bytes)) != -1) {
116 fos.write(bytes, 0, read);
121 MailAttachment ma =
new MailAttachment(attach.getAbsolutePath(), title +
".pdf",
null);
122 ma.attachment = attach;
124 MailSenders.getPool()
125 .setRoot(
"/financials")
126 .addContacts(contacts)
127 .addMailAttachments(attachments)
129 .put(
"comment", comment)
131 .put(
"mas", attachments)
132 .sendTemplate(
"document", ElephantContext.getSiteName() +
": " + title);
133 }
catch (Exception ex) {
134 Logger.getLogger(
ReportPrint.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
"Sending mails"), ex);
◆ setReport()
void org.turro.zkoss.print.ReportPrint.setReport |
( |
Jasperreport |
report | ) |
|
The documentation for this class was generated from the following file: