A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
iReport in Struts action
Aditya Kanitkar
Ranch Hand
Joined: Aug 08, 2009
Posts: 72
posted
Dec 30, 2010 22:11:35
0
Hi,
I want to implement iReport from Struts action...
I have got some code... But there is some problem...
Anyone has some idea about this....
Something like this....
ServletOutputStream outputStream = response.getOutputStream(); System.setProperty("jasper.reports.compile.class.path", "/WEB-INF/lib/jasperreports-3.7.6.jar" + System.getProperty("path.separator") + "/StrutsExample1" + "/build/classes"); File reportFile = new File( realPath + reportName + ".jasper"); Map parameters = new HashMap(); String loginName = "gerry"; parameters.put("loginName", loginName); bytes = JasperRunManager.runReportToPdf(reportFile.getPath(),parameters ,dbConn); if (bytes != null && bytes.length > 0) { response.setContentType("application/pdf"); response.setContentLength(bytes.length); outputStream.write(bytes, 0, bytes.length); outputStream.flush(); outputStream.close(); }
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
2
I like...
posted
Dec 30, 2010 23:10:51
0
But there is some problem
1) iReports is a GUI editor for JasperReports, your problem is related to JasperReports not iReports.
2) It would be great if you could explain what the actual problem is, read
this
...
SCJP 6 | SCWCD 5 |
Javaranch SCJP FAQ
|
SCWCD Links
Aditya Kanitkar
Ranch Hand
Joined: Aug 08, 2009
Posts: 72
posted
Jan 03, 2011 05:33:16
0
I've already added few jar files... But right now, I'm getting this error...
java.lang.NoClassDefFoundError
: org/jfree/data/general/Dataset
After searching that jar file... I downloaded and put jfreechart-0.9.19.jar this file in my WebContent/WEB-INF/lib folder....
Any idea about this...
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: iReport in Struts action
Similar Threads
Jasperreports + Struts
JSP and iReports without database connection
Jasper Reports Excel Output
Blank page
Display Pdf Content
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter