Overview#
This sample demonstrates how to send a Jasper report via email.The sample uses the Sun mail api to send two jasper reports in one email. The first report is sent as a PDF attachment while the second report is sent as the body of the email including automatically embedding any required images into the email.
SendMail contains a test driver and is the logical starting place.
Note: the JasperReport class is my own wrapper class.
Known issues:#
- The code has had only limited testing.
- It uses two jasper reports which aren't included in the sample code (just add your own).
- When attaching images to the email it doesn't appear to be possible to determine the
- The sample assumes that your report uses and JDBC datasource (sample uses MSSQL).
Source TOC#
Add new attachment
List of attachments
| Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
|---|---|---|---|---|---|---|
java |
ByteArrayDataSource.java | 1.7 kB | 1 | 12-Dec-2003 01:07 | Ebu | |
java |
DBServer.java | 1.6 kB | 1 | 12-Dec-2003 01:07 | Ebu | |
java |
JasperHTMLReport.java | 2.7 kB | 1 | 12-Dec-2003 01:07 | Ebu | |
java |
JasperPDFReport.java | 4.4 kB | 10 | 25-Apr-2007 09:30 | 199.67.140.154 | |
java |
JasperReport.java | 4.6 kB | 3 | 29-May-2005 20:56 | 82.216.174.161 | |
java |
SendMail.java | 7.1 kB | 1 | 12-Dec-2003 01:07 | Ebu |
