Skip to main content

Posts

Showing posts from December, 2011

Using a Servlet to generate chart images for BIRT

I've been working with Google's chart tools -- specifically their Image Chart tools .  My problem -- I'm using BIRT as my PDF report engine, but I have a web interface.  I want the report to look the same on the web as it does in BIRT (which has it's own excellent native charting library).  I decided the easiest way is to use an image tag, but I have the potential for copious data, so I have to use a POST instead of a GET. Google lists an excellent hack using a form and an Iframe as a way to submit the post and that works for me from the web.   It does not work inside of BIRT -- because as far as I know there is no way to submit a form inside of a report.  Instead I decided to use an image tag which runs through a servlet I host. So now I can write on my web page: <img src="../chart/chart.png"> and I can include in a dynamic text in my BIRT report "<img src='http://mywebserver/chart/chart.png'>"  //outside quotes requ...