kennethmch
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forum
Events
Featured Visualizations
Knowledge Base
Documentation (PDF Downloads)
Blog
Documentation (Test Area)
Documentation
Dr. Jaspersoft Webinar Series
Downloads
Posts posted by kennethmch
-
-
Assuming you already have the jasperprint object
Code: response.setContentType("image/jpeg"); BufferedImage pageImage = new BufferedImage(jasperPrint.getPageWidth() + 1, jasperPrint.getPageHeight() + 1, BufferedImage.TYPE_INT_RGB); exporter = new JRGraphics2DExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); Map imagesMap = new HashMap(); request.getSession().setAttribute("IMAGES_MAP", imagesMap); exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.FALSE); exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, context+"/images?image="); exporter.setParameter(JRGraphics2DExporterParameter.GRAPHICS_2D, pageImage.getGraphics()); exporter.setParameter(JRExporterParameter.PAGE_INDEX, new Integer(0)); exporter.exportReport(); output = bufferedImageToByteArray(pageImage); public static byte[] bufferedImageToByteArray(BufferedImage img) throws IOException{ ByteArrayOutputStream os = new ByteArrayOutputStream(); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os); encoder.encode(img); return os.toByteArray(); }
problem with daylight saving in JfreeChart
in Products
Posted
Hi, sorry for posting another question here.
I do not know the solution for your question, and im just wonder how did you embed the jfreechart into jasperreport? Can you please post some of your scriptlet, jrxml and your related java code? many thanks