c33 Posted October 13, 2009 Share Posted October 13, 2009 Hi all,pls help me.. i want to try build report with jasper report, but i dont know how to view / embedded jasper report on my web page.everybody can give me example. thx for attention... Link to comment Share on other sites More sharing options...
giobby Posted October 13, 2009 Share Posted October 13, 2009 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 More sharing options...
c33 Posted October 13, 2009 Author Share Posted October 13, 2009 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. Link to comment Share on other sites More sharing options...
giobby Posted October 13, 2009 Share Posted October 13, 2009 sorry...Anyway this matter is interesting also for me,so i'll look for something to solve this fix.Au revoir Giovanni...La puissance est rien sans controle... Link to comment Share on other sites More sharing options...
zecas Posted October 13, 2009 Share Posted October 13, 2009 c33Wrote: 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 More sharing options...
c33 Posted October 13, 2009 Author Share Posted October 13, 2009 i never try iframe. can you give me an example code to set url on iframe thx before Link to comment Share on other sites More sharing options...
zecas Posted October 13, 2009 Share Posted October 13, 2009 c33Wrote: 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 More sharing options...
c33 Posted October 15, 2009 Author Share Posted October 15, 2009 zecasWrote: 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 More sharing options...
omkar_gunari Posted September 27, 2011 Share Posted September 27, 2011 c33Wrote: 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now