cparis Posted September 30, 2006 Share Posted September 30, 2006 HII am using Jasper Reports to create the aplication reports. For this I created a BarChart that would export the reports in two file formats, PDF and html, the problem is, that the BarChart doesnt work when I choose to export in html. Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted September 30, 2006 Share Posted September 30, 2006 How doesn't it work? Are there errors being thrown during export, or is the layout not what you expect? You should always keep in mind when designing your reports is that there are certain report designs and layouts that are best suited depending on the output destination. i.e. a CSV output file has very strict rules about how you should place elements in your report in order for it to be interpreted as fields properly. Anyways, please elaborate on how your report is failing in html mode and we can try to work through it. Thx,Rob Link to comment Share on other sites More sharing options...
cparis Posted October 2, 2006 Author Share Posted October 2, 2006 Im using a web application to export reports in two formats html and pdf, this reports are created with JasperReport. I made a barchart but when I try to export it to html the graphic is not displayed. Link to comment Share on other sites More sharing options...
dheffelfinger Posted October 3, 2006 Share Posted October 3, 2006 JasperReports includes a servlet to handle images in reports exported to HTML. My guess is that you are not using this servlet. Include the this servlet in your web.xml, something like this: Code:<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>image</url-pattern></servlet-mapping> Your Java code should look something like this: Code:[code]JRHtmlExporter exporter = new JRHtmlExporter();...exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="«»);...exporter.exportReport(); For more information, check out chapter 9 of my book, [url=http://www.packtpub.com/JasperReports/book]JasperReports For Java Developers. David Link to comment Share on other sites More sharing options...
cparis Posted October 4, 2006 Author Share Posted October 4, 2006 Thanks for your answer, but I have the servlet in my web.xml and I have the class HtmlServlet.java, in this class I put the parameter: setParameter(JRHtmlExporterParameter.IMAGES_URI, "image?image="); My images are displayed in HTML but the BarChart is not displayed, the page is blank when I try try to export it . Link to comment Share on other sites More sharing options...
lucianc Posted October 4, 2006 Share Posted October 4, 2006 Maybe some other report element overlaps over the bar chart element. Some exporters (e.g. PDF) are able to export overlapping elements, but grid-like exporters (like Html) will only export the element at the top. Regards,Lucian 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