Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Which class holds the chart image in Birt runtime environment
wizkid
Which class holds the chart image in Birt runtime environment? Does anyone happen to know that?
Find more posts tagged with
Comments
JasonW
In what context? Can you give some more detail on what you are trying to do?
Jason
wizkid
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="82023" data-time="1314631571" data-date="29 August 2011 - 08:26 AM"><p>
In what context? Can you give some more detail on what you are trying to do?<br />
<br />
Jason<br /></p></blockquote>
<br />
I'm trying to skip the part where birt writes charts to disk and instead; wright it to another outputstream. If I could get the part where Birt runtime engine writes it to disk or atleast saves the chart somewhere in the memory. I could patch Birt in to passing it through another outputstream.<br />
<br />
I know I could use the Chart engine, but runtime saves a lot of work and the minor adjustment I would like to see, shouldn't be that big of a problem. That is if the Birt runtime engine schematics is understood.
JasonW
Understood. You need to look at the image handler classes (HTMLCompleteImageHandler and HTMLServerImageHandler). These are the classes that are actually writting the images to disk. The chart engine returns an image in memory to the image handler. I assume you are going to try and base64 encode the image and use the img src tag to declare bas64 encoded image? You can make your own image handler by extending HTMLImageHandler. You set it in the render options like:
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("output/resample/mytopnimage.html");
options.setOutputFormat("HTML");
options.setImageHandler(new MyImageHandler());
You image handler will then be called by the report engine when the chart returns the image. Specifically the
public String onCustomImage( IImage image, ReportContext context )
{
return handleImage( image, context, "custom", false );
}
will be called. This method should return a string that will be set in the emitted html as a src tag.
Jason