import java.io.IOException; import java.io.OutputStream; import java.io.Writer; import java.sql.Connection; import java.sql.SQLException; import java.util.Map; import dori.jasper.engine.JRException; import dori.jasper.engine.JasperRunManager; /* * Created on 5/11/2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author bsutton * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ class JasperPDFReport extends JasperReport { byte[] m_bytes = null; JasperPDFReport( String strReportPath, String strTitle, String strImagePath, Map mapParameters) throws JRException, IOException { super(strReportPath, strTitle, strImagePath, mapParameters); } protected void format(Connection conn) throws SQLException, JRException { m_bytes = JasperRunManager.runReportToPdf(m_report, m_mapParameters, conn); } protected void output(java.io.OutputStream out) throws JRException, IOException { if (m_bytes != null && m_bytes.length > 0) { out.write(m_bytes, 0, m_bytes.length); out.flush(); } else { throw new JRException( "The report contained no content. " + "If this problem persists please contact your system administratror."); } } void write(Connection conn, OutputStream out) throws IOException, SQLException, JRException { format(conn); output(out); } }