aspose file tools*
The moose likes JSP and the fly likes Error while exporting to PDF using Jasper Report Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Error while exporting to PDF using Jasper Report" Watch "Error while exporting to PDF using Jasper Report" New topic
Author

Error while exporting to PDF using Jasper Report

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
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

Joined: May 26, 2003
Posts: 30762
    
156

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 263
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

Joined: Jan 10, 2002
Posts: 61426
    
  67

Aravind Prasad wrote:This is really very urgent.

Please read this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

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

Joined: Dec 28, 2005
Posts: 263
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while exporting to PDF using Jasper Report