• 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

Error while exporting to PDF using Jasper Report

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Aravind Prasad wrote:This is really very urgent.


Please read this.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic