Jump to content

[ASK] Embedded jasper report view on web page


c33

Recommended Posts

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi, theese are two examples to print a report created with iReport in your servlet.

The first print the pdf on your file system.

The second print the pdf directly on browser

 



 

Giovanni

...La puissance est rien sans controle...

 

Code:

It helped me.



Post Edited by giobby at 10/13/2009 13:25
Link to comment
Share on other sites

c33
Wrote:

that's not i mean,

i want to show the report on the web page, not show to new page page on browser.

thx for your reply.

You want to display the PDF inside your application webpage, like for example replacing the quoted block above by a PDF?

Have you tried iframe?

Personally I hate them /tools/fckeditor/editor/images/smiley/msn/teeth_smile.gif but with an iframe you would set an URL to your PDF file ... that could be dinamically generated by a back Servlet.

Code for servlet could be something similar to the one I attached.

(Note: Code created by hand, so there may be some typo)

Code:

 



Post Edited by zecas at 10/13/2009 13:50
Link to comment
Share on other sites

c33
Wrote:

i never try iframe.

can you give me an example code to set url on iframe

thx before

 

Html code is attached.

Code:

Now instead of linking to a PDF file, you could link to a servlet that will generate and return the report, dinamically.

http://www.yoursite.com/ServletThatGeneratesPDF

 

Code for the servlet is similar to what I posted in a previous message.



Post Edited by zecas at 10/13/2009 16:33
Link to comment
Share on other sites

zecas
Wrote:

c33
Wrote:

i never try iframe.

can you give me an example code to set url on iframe

thx before

 

Html code is attached.

Code:

Now instead of linking to a PDF file, you could link to a servlet that will generate and return the report, dinamically.

http://www.yoursite.com/ServletThatGeneratesPDF

 

Code for the servlet is similar to what I posted in a previous message.



Post Edited by zecas at 10/13/2009 16:33

thank's for your reply.

the code successful

 

/tools/fckeditor/editor/images/smiley/msn/teeth_smile.gif

Link to comment
Share on other sites

  • 1 year later...

c33
Wrote:

zecas
Wrote:

c33
Wrote:

i never try iframe.

can you give me an example code to set url on iframe

thx before

 

Html code is attached.

Code:

Now instead of linking to a PDF file, you could link to a servlet that will generate and return the report, dinamically.

http://www.yoursite.com/ServletThatGeneratesPDF

 

Code for the servlet is similar to what I posted in a previous message.



Post Edited by zecas at 10/13/2009 16:33

thank's for your reply.

the code successful

 

/tools/fckeditor/editor/images/smiley/msn/teeth_smile.gif

hi , i tried this code but it is giving

java.lang.NullPointerException	java.io.ObjectInputStream$PeekInputStream.read(Unknown Source)	java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)	java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)	java.io.ObjectInputStream.readStreamHeader(Unknown Source)	java.io.ObjectInputStream.<init>(Unknown Source)	net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.<init>(ContextClassLoaderObjectInputStream.java:53)	net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:200)	net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:603)	net.sf.jasperreports.engine.JasperRunManager.runReportToPdfStream(JasperRunManager.java:370)	jasperController.JasperControl.doGet(JasperControl.java:30)	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

:(

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...