This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error while exporting to PDF using Jasper Report

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,

I am trying to export a report in pdf document using jasper report. I got the code from some sites while searching in the google search engine. Attached here with the following files


Below is the error messgae i am getting from the system


Please help me to rectify this problem

Regards

Aravind
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aravind,
First of all, note that it's horrible practice to have large chunks of code in a JSP. Good practice would have no code, but static methods are even worse. It makes debugging and maintenance very difficult.

In this particular case, the whole thing should be a servlet and there should be no JSP. After all, if you have a PDF, you shouldn't have HTML too. What would the browser do wit that?

Try copying that large method into a servlet and printing the result to the output.
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne

Thank you for your reply. I am very new to the Jasper Report and I would really appreciate, if i can get a real help of the code, which can able to export to pdf from jasper report.
This is really very urgent.

Thanks/aravind
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64975
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aravind Prasad wrote:This is really very urgent.

Please read this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64975
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Try copying that large method into a servlet and printing the result to the output.

Jeanne has already given you the next step.
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

Thankyou for your inputs. I could finally export the jasper report to PDF format. I have tested it OK.

I have now another problem for passing the parameter to jrxml file to create dynamic report. Every time, depending on the unique key, the report has to bring the information from the database.

Below is the XML code for the report and the the parameter which I am passing is file_no, which I am manipulating in the query.

The jrxml, compiled successfully but in the PDF it is not having any values. Please help me.



Aravind
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic