To dispaly jfree chart as Image in jasper reports

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
anjanas
Posts: 5
Joined: Fri Mar 28, 2008 5:41 am

To dispaly jfree chart as Image in jasper reports

Post by anjanas » Tue Apr 15, 2008 11:58 am

I wanted the jfree chart to display as an image in Jasper Reports .

I have creasted a BufferedImage from jfree chart as given below
bufferedImage = jfree.createBufferedImage(width,height,renderingInfo);


In my jasper template I have an image with an expression java.awt.Image and a parameter-CHART to map the image in jasper.


But when viewed in webpage , I can only see a blank out line and it says
The image “http://localhost:8080/sample/image?image=img_0_0_2” cannot be displayed, because it contains errors.

The call for rendering the image is done by jasper reports internally .
jasperPrint = JasperFillManager.fillReport(inputStream,getParameters(), JasperReportDataSource;

I pass the chart as parameter to jasper report with key as the parameter-CHART created in template and buffered Image created using jfree as value for displaying the chart in jasper.

In previous version of jfree , it worked ..But with jfree-1.0.9 , it is not ...Pls help to find a way to resolve this . How can I go about this .. I found that the image producing source in jfree is sun.awt.image.OffScreenImageSource . Is this causing the issue ? pls help me .

Locked