ktrinad Posted August 20, 2006 Share Posted August 20, 2006 By: Christian Haul - chaul Integrate Charts as Vector Graphics? 2004-05-14 00:39 Hi all, After having integrated jfreecharts sucessfully into my reports by writing two generic scriptlets I'm a little disappointed that apparently I have to use a bitmapped image although the charts library can produce SVG or PDF as jasperreports can do as well. Well, actually, neither supports SVG or PDF natively, but by drawing on a suitable Graphics2D object provided by apache batik or itext both can produce SVG or PDF. Since I'm quite new to both jasperreports and jfreecharts I'd like to hear some advice on how to best proceed. Obviously, I'd like to produce best quality PDF and SVG output from jasperreports including charts. So far, the best solution I can think of is to replace the internal representation of images as array of bytes in jasperreports with a SVG DOM. Consequently, passing the image data around needs to use org.w3c.dom.Document (or Node) instead of byte[]. However, this would introduce a dependency on apache batik since in the end batik would be needed to draw the image either on an itext Graphics2D object when exporting to PDF or to a real AWT Graphics2D or again a SVGGraphics2D for inclusion in a produced SVG or ... In exchange, it would make it a little nicer to include images inline in a report definition XML. Changing the internal representation to SVG DOM would require changes to the jasperreports core classes at a number of places. Would a patch doing this have a chance of being accepted? Thought, ideas? Chris. By: Lars Kristensen - llk RE: Integrate Charts as Vector Graphics? 2004-05-14 01:01Se the patch 'Vector graphics (inc. chart) support' and the later updates in the patch section: https://sourceforge.net/tracker/?group_id=36382&atid=416705 I have used the patch with great results. Best Regards llk By: Christian Haul - chaul RE: Integrate Charts as Vector Graphics? 2004-05-14 02:31Great! Absolutely fabulous! Works like a charm. Applying the patch to 0.5.2 needed a high fuzz factor and one import statement did not apply cleanly. But other than that it was painless. I have even added the Rendable type to my local ireporter copy :-) Cheers for pointing me to this patch. Hope it's going to be incorporated soon. By: Jian Zhou - efly RE: Integrate Charts as Vector Graphics? 2004-05-17 19:11Fantastic idea! Uses iText pdfTemplate of Graphices2D. I have worked it out for Chinese fonts support in version 0.5.2 with little patch of iText. Link to comment Share on other sites More sharing options...
karenper Posted March 8, 2007 Share Posted March 8, 2007 Hi llk, I tried accessing the link you've mentioned in the above post but am unable to do so.Could you help me out further? Please reply asap!!! klp 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