Jump to content
Changes to the Jaspersoft community edition download ×

Jasper with Java Studio Creator : HELP !!


2005 IR Help

Recommended Posts

By: pierre_dsd - pierrelecointre

Jasper with Java Studio Creator : HELP !!

2005-06-30 06:51

Hi!

 

I'm working on jsf project with Java Studio reator, and I'd like to work with Jasper reports but it doesn't work.

 

Well, here is the problem :

I took from sun's forum an example with jsf and JSC and jasper6.1 : http://swforum.sun.com/jive/thread.jspa?threadID=50166&tstart=0

 

It works fine, but t only works with the provided library 6.1 and with the compiled ".jasper" file.

 

If I change the library (6.8) of jasper, it doesn't work anymore. If I try it with an other compiled ".jasper" file, it doesnt work too.

 

do you have a solution for me ?? It would be cool because I'm becoming crazy !

 

Thanks a lot

 

Pierre

 

 

 

 

By: Paul Meshkovsky - meshpaul

RE: Jasper with Java Studio Creator : HELP !!

2005-06-30 07:59

Well,

 

You will need to take *.JRXML file and recompile them in newver version of JasperReports otherwise it will not be compatiple with new libs. iF you have JasperReports in samples there is webapp demo some of the compile source code you can borrow to make your application have ability to recompile JRXML files into JASPER files. good luck.

 

 

 

 

By: pierre_dsd - pierrelecointre

RE: Jasper with Java Studio Creator : HELP !!

2005-06-30 08:23

Thank you for your answer !

 

but I already tried what you said

 

I used in fact the webapp demo to try to compile with my jsc project butit didnt work, how can I make it compile ?

 

So, I tryed to compile the same file with 6.8 jasper version with the webapp running in tomcat, and that worked fine, but with 6.8 on jsc andthis compiled file it doesnt work !!

 

so whatshould I do ?

 

 

 

 

 

By: pierre_dsd - pierrelecointre

RE: Jasper with Java Studio Creator : HELP !!

2005-06-30 08:36

This works fine with the jrxml provided and jasper 6.1 :

 

********************************

InputStream is=null;//contains the report .jasper file

JasperReport jreport=null;

byte[] pdf=null;

classReportingManager mr = new classReportingManager();

try {

is=mr.getReportIS(report,conn);

}

catch(SQLException e){}

//Map parameters = new HashMap();

//SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

//parameters.put("DATE", new String(format.format(dt1)));

parameters.put("TESTVAR", new Integer(2));

try {

 

pdf = JasperRunManager.runReportToPdf(is,parameters,conn);

}

catch (JRException jre){}

 

 

******************************

 

But this dosent work, with same config (6.1) or with 6.8 !!!!!!

 

InputStream is=null;//contains jrxml file <<<<<<

JasperReport jreport=null;

byte[] pdf=null;

classReportingManager mr = new classReportingManager();

try {

is=mr.getReportIS(report,conn);

}

catch(SQLException e){}

//Map parameters = new HashMap();

//SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

//parameters.put("DATE", new String(format.format(dt1)));

parameters.put("TESTVAR", new Integer(2));

try {

 

jreport= JasperManager.compileReport(is);

pdf = JasperManager.runReportToPdf(jreport,parameters,conn);

}

catch (JRException jre){}

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...