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)
Image handling while generating report as a stream
kankane
Hi,
I have to generate html file and sending it as a ByteArrayOutputStream like below for attachment purpose.
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
HTMLRenderOption htmlOptions = new HTMLRenderOption();
htmlOptions.setOutputStream(ostream);
htmlOptions.setOutputFormat("html");
IRunAndRenderTask htmlTask = engine.createRunAndRenderTask(design);
htmlTask.setRenderOption(htmlOptions);
htmlTask.setParameterValues(parameters);
htmlTask.run();
htmlTask.close();
return ostream;
what happens about the chart images. And how to handle this situation so that images will not be lost.
Because I have to report as a attachment could you please tell me how to include images in that stream.
Thanks,
Sachin
Find more posts tagged with
Comments
kankane
Could some one please answer this query.
Thanks,
Sachin
kankane
Hi,
Could some one please reply on above mention question. This is really very urgent.
Thanks,
Sachin
mcremer
kankane,<br />
<br />
First don't push, the community is widely spread around the globe in time zone so sometimes it will take time. (for example mwilliams is in american time zone and im in Europe).<br />
<br />
Secondly with a bit of googeling (I never tried this my self) i found this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>$taskOptions = new java("org.eclipse.birt.report.engine.api.HTMLRenderOption");
$outputStream = new java("java.io.ByteArrayOutputStream");
$taskOptions->setOutputStream($outputStream);
$taskOptions->setOutputFormat("html");
$ih = new java( "org.eclipse.birt.report.engine.api.HTMLServerImageHandler");
$taskOptions->setImageHandler($ih);
$taskOptions->setBaseImageURL($imageURLPrefix . session_id());
$taskOptions->setImageDirectory($here . "/sessionChartImages/" . session_id());
$task->setRenderOption( $taskOptions );
$task->run();
$task->close();
</pre>
<br />
now this is for php. But this tells me that you need to do somting with the: <br />
org.eclipse.birt.report.engine.api.HTMLServerImageHandler<br />
<br />
If you look in to that documenation I think you can set a image directory and make streams of that 2 to share.