Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
iReport in Struts action
Aditya Kanitkar
Ranch Hand
Posts: 72
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Sheriff
Posts: 9707
43
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 72
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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...
No thanks. We have all the government we need. This tiny ad would like you to leave now:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Display Pdf Content
Jasper Reports Excel Output
Jasperreports + Struts
Blank page
JSP and iReports without database connection
More...