Problem in exporting data into pdf
Hi All,
Am trying to create pdf file through the following java class.
public class JasperReportDemo
{
public static void main(String[] args) throws SQLException, FileNotFoundException,
ClassNotFoundException,Exception
{
try
{
final String driverClass = "oracle.jdbc.driver.OracleDriver";
final String connectionURL = "jdbc:oracle:thin:@xxxxxxxx:1535:yyyyyyyy";
final String userID = "Caaaaaaaa";
final String userPassword = "bbbbbbbb";
Connection con = null;
Statement stmt = null;
ResultSet rset = null;
Class.forName(driverClass).newInstance();
con = DriverManager.getConnection(connectionURL, userID, userPassword);
String queryString = "SELECT STOCKROOM_ID, STOCKROOM_NAME, STOCKROOM_DESC "
+ "FROM stockroom ";
stmt = con.createStatement();
rset = stmt.executeQuery(queryString);
InputStream input = new FileInputStream(new File("e:/stockroom.xml"));
JasperDesign design = JRXmlLoader.load(input);
JasperReport report = JasperCompileManager.compileReport(design);
JRResultSetDataSource jasperReports = new JRResultSetDataSource(rset);
JasperPrint print = JasperFillManager.fillReport(report, new HashMap(), jasperReports);
long start = System.currentTimeMillis();
OutputStream output = new FileOutputStream(new File("e:/JasperReport.pdf"));
System.out.println("---------------------> Done PDF paaaaaa");
JasperExportManager.exportReportToPdfStream(print, output);
}
catch(JRException e)
{
System.out.println(e);
}
}
}
am getting the following error:
net.sf.jasperreports.engine.JRException: Error compiling report java source files : F:\eclipse\workspace\PreOrder_pdfGen\JasperReport_ 1207220245603_337666.java
can any one help me out to sort the issue::)
|