• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Error while exporting to PDF using Jasper Report

 
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
 
author & internet detective
Posts: 40169
812
Eclipse IDE VI Editor Java
  • 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
 
Marshal
Posts: 67446
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Aravind Prasad wrote:This is really very urgent.


Please read this.
 
Bear Bibeault
Marshal
Posts: 67446
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
 
Would you like to try a free sample? Today we are featuring tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic