Jump to content
Changes to the Jaspersoft community edition download ×

Problem: engine.JRException


2006 IR Open Dicussion

Recommended Posts

By: perrin - perrin_hk

Problem: engine.JRException

2006-06-04 21:32

Hello,

 

I have some problem on ireport. Anyone can help me ? Thanks !

 

I created a simple report on ireport1.2.2 version, it is no problem run on ireport Designer. So it generated two files xxx.jasper and one xxx.java, then I open a Sun Java Studio Creator 2 to create a simple web page. This page will get data from MySQLDB then pass to JasperReport. After run the web page, it shows: error net.sf.jasperreports.engine.JRException: Error compiling report design

 

here is my program:

public void test()

{

Connection Conn = null;

Statement Stmt = null;

ResultSet ResSet = null;

String sql = "";

 

try

{

Class.forName("org.gjt.mm.mysql.Driver");

Conn = DriverManager.getConnection("jdbc:mysql://192.168.100.73/MPNS","root","pwd");

Stmt = Conn.createStatement();

 

sql = "SELECT logtime,man,uin,cmd FROM usagelog WHERE logtime like '2006-05-01%'";

ResultSet rs = Stmt.executeQuery(sql);

String fileName = "D:\Project\iReport\test3\usagelog.jasper";

 

Map parameters = new HashMap();

parameters.put("rptfromdate", "2006-05-01");

parameters.put("rpttodate", "2006-05-01");

 

JasperDesign design = JRXmlLoader.load("D:\Project\iReport\test3\usagelog.jrxml");

JasperReport report = JasperCompileManager.compileReport(design);

 

JasperPrint print = JasperFillManager.fillReport(report,parameters,new JRResultSetDataSource(rs));

JasperExportManager.exportReportToPdfFile(print, "D:\Project\iReport\test3\usagelog.jrprint");

}

catch(Exception e)

{

info("error " + e);

}

finally

{

try

{

Conn.close();

}

catch(Exception e)

{

info("close mysql connection fail !");

}

}

}

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...