ireport SSH2使用ireport无法显示图片问题

ireport设计有logo图和饼图,集成到SSH2中后图形都不显示

解决:要有
request.getSession().setAttribute(                                    ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE,jasperPrint);
需要把jasperPrint放入session,这样,ireport的图片显示服务器才能访问jasperPrint对象,显示出相应的图像出来

ireport显示外部图片的具体步骤:
1.在web-bin设置ireport图片显示服务:
<servlet>
        <servlet-name>ImageServlet</servlet-name>
        <servlet-class>net.sf.jasperreports.j2ee.servlets.ImageServlet</servlet-class>
    </servlet>
<servlet-mapping>
        <servlet-name>ImageServlet</servlet-name>
        <url-pattern>/servlets/image</url-pattern>
    </servlet-mapping>
2.设置ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTEsession
request.getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE,jasperPrint);
3.设置图片servlet服务的路径:
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,"servlets/image?image=");

黑色头发:http://heisetoufa.iteye.com/

你可能感兴趣的:(IREPORT)