nasimjo Posted April 18, 2007 Share Posted April 18, 2007 Im using Jasper reports rendered as html throughout a servlet.I have all my reports working except for those that do include charts, where the charts image do not appear in the result of hitting the servlet. that is, despite the fact that the imageServlet URL is set properly in the web.xml. and noting that no other image rendering problems were reported Link to comment Share on other sites More sharing options...
teodord Posted April 18, 2007 Share Posted April 18, 2007 Hi, Maybe the other images that seem to work are lazy loaded (isLazy="true") and in fact the image servlet is not mapped correctly or it does not work for some reason. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
nasimjo Posted April 18, 2007 Author Share Posted April 18, 2007 well, i know that the image Servlet is working by the fact that i use Code:htmlExporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, new Boolean(true)); and when i change the imageServlet's mapping or name that page become full of "not rundered image" icons replacing the layout images. So this is where i got sure the imageServlet IS WORKING! Link to comment Share on other sites More sharing options...
teodord Posted April 18, 2007 Share Posted April 18, 2007 Hi, Most of the times, the reason for not seeing elements in HTML is that they overlap with some other elements. Note that the HTML exporter is a grid exporter and these do not support overlapping elements. Please see this:http://jasperforge.org/sf/wiki/do/viewPage/projects.jasperreports/wiki/FAQ9 I hope this helps.Teodor Link to comment Share on other sites More sharing options...
nasimjo Posted April 18, 2007 Author Share Posted April 18, 2007 I actually know that .... i tried it with a bare naked report with only the chart in it ... and still facing the problem. just for instance, and it case it might help. hitting the imageServlet with the URI referenced by the image (which is in my case: http://localhost:8084/JasperTest/image?image=img_0_0_41)results in this : Code:javax.servlet.ServletException: No JasperPrint documents found on the HTTP session. net.sf.jasperreports.j2ee.servlets.ImageServlet.service(ImageServlet.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368) Link to comment Share on other sites More sharing options...
nasimjo Posted April 18, 2007 Author Share Posted April 18, 2007 finally, a colleague suggested a line of code he remembered he used once upon a time ... and it worked :) here it goes for those who might face the case Code:request.getSession().setAttribute( ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, jasperPrint); Link to comment Share on other sites More sharing options...
crystalzting Posted April 21, 2007 Share Posted April 21, 2007 hi, i have the same problem that the chart cannot show in html file...even though i did what you said, there still the problem. anymore tips??thx. :huh: Link to comment Share on other sites More sharing options...
jfkang Posted April 9, 2008 Share Posted April 9, 2008 I am meeting this proplem too:when I use the following link http://localhost:9080/RdzxJbpm/servlet/image?image=img_0_1_0 Exception shows the following:javax.servlet.ServletException: No JasperPrint documents found on the HTTP session. net.sf.jasperreports.j2ee.servlets.ImageServlet.service(ImageServlet.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) but if I use http://localhost:9080/RdzxJbpm/servlet/image?image=pxIt's no problem can anybody give more message, thxPost edited by: jfkang, at: 2008/04/08 17:36 Link to comment Share on other sites More sharing options...
malani_manish Posted December 23, 2008 Share Posted December 23, 2008 I am also facing the same issue.I have also tried quering servlet from url for 'px' and 'img_0_0_9' and face the same result as jfkang is getting.can anybody help me to produe chart image in html export.I have ensured that no overlapping, and image uri parameter is set very well, servlet working absolutely fine for blank images.please help. Link to comment Share on other sites More sharing options...
ajithn Posted March 15, 2010 Share Posted March 15, 2010 Hi all,I'm also got this issue. Charts works fine for the PDF reports. but HTML report does not display that chart.any hints ??Thanks Link to comment Share on other sites More sharing options...
teodord Posted March 15, 2010 Share Posted March 15, 2010 Hi, It is almost impossible to tell what is wrong in your case withouth actually sitting at your desk.So I suggest you investigate the situation yourself, trying to understand why the /demo/samples/webapp sample shipped with the JR project distribution package works. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
rbabutin Posted June 4, 2010 Share Posted June 4, 2010 Thank you nasimjo!! That was exactly the missing piece in the puzzle for me trying to display the chart. Works great :) Link to comment Share on other sites More sharing options...
ajithn Posted June 14, 2010 Share Posted June 14, 2010 Hi All ,plz follow the steps given below to view charts @ Html reports1. set the image servlet @ your web.xml file <servlet> <servlet-name>ImageServlet</servlet-name> <url-pattern>/servlets/image</url-pattern> <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class></servlet> 2. set the follwing parameters @ your report generation servletjrHtmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "../servlets/image?image=");request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE , jasperPrint); Thanksajithn Post Edited by ajithn at 06/14/2010 08:55 Link to comment Share on other sites More sharing options...
mici387 Posted October 22, 2012 Share Posted October 22, 2012 Gracias :D ajithn funcion perfecto :P 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