Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
Register
| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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::)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:31 PM.


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