Jump to content
Changes to the Jaspersoft community edition download ×

Charts not working/HTML Jasper report from Servlet


nasimjo

Recommended Posts

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

  • Replies 13
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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

  • 11 months later...

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=px

It's no problem

 

can anybody give more message, thx

Post edited by: jfkang, at: 2008/04/08 17:36

Link to comment
Share on other sites

  • 8 months later...

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

  • 1 year later...

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

  • 2 months later...
  • 2 weeks later...

Hi All ,

plz follow the  steps given below  to view charts @ Html reports

1. 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 servlet

jrHtmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "../servlets/image?image=");

request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE

, jasperPrint);

 

Thanks

ajithn

 

 



Post Edited by ajithn at 06/14/2010 08:55
Link to comment
Share on other sites

  • 2 years later...

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...