Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
| Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2008, 06:15 AM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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::)




Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data to PDF file using ASP m_soni21 Classic ASP Professional 1 September 16th, 2008 12:15 PM
problem in Exporting Crystal report to PDF cat_net Crystal Reports 0 October 3rd, 2005 11:49 PM
Problem Exporting Data... mat41 SQL Server 2000 1 September 29th, 2005 08:35 PM
Exporting data to excel from datagrid, Problem. swadhinm ASP.NET 1.x and 2.0 Application Design 0 May 31st, 2005 01:44 AM
Problem in exporting data to PDF vasansrini Crystal Reports 1 December 10th, 2004 11:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.