anyulled Posted July 12, 2010 Share Posted July 12, 2010 Greetings. I've been trying to display my report in html but it doesn't show correctly the images, instead, I see every image has as a src attribute the word nullimg followed by a series of numbers ( like nullimg_0_33_66).I've read in some other place that I have to use an image servlet for that purpose, but I can't find it here. this is the code i'm using for the Html Exporter: JRHtmlExporter htmlExporter = new JRHtmlExporter(); htmlExporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE); htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); htmlExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, byteArrayOutputStream); htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, "/opt/apache-tomcat-6.0.18/webapps/Simm/images"); htmlExporter.exportReport(); Code:JRHtmlExporter htmlExporter = new JRHtmlExporter(); htmlExporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE); htmlExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); htmlExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, byteArrayOutputStream); htmlExporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, "/opt/apache-tomcat-6.0.18/webapps/Simm/images"); htmlExporter.exportReport(); Link to comment Share on other sites More sharing options...
lacito Posted July 13, 2010 Share Posted July 13, 2010 Hi, You can find ImageServlet.java in the following folder:src\net\sf\jasperreports\j2ee\servlets\ I hope it helps,Laszlo 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