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)
Birt runAndRender set output image name
bkabka
Hi, recently I integrated Birt in my web application. For report presentation it is used runAndRender method where i'm able to set output image path with `htmlOptions.setImageDirectory()` before running task.
Is it possible to get impact on produced .png image name?
And also is there a better(faster) way to produce only report image (without serving html which includes image link on file system and correspoding html tags)?
Find more posts tagged with
Comments
mwilliams
Sorry, I'm not sure I'm understanding exactly what you're looking for. Can you explain a little more? Thanks.
bkabka
Oh, sorry for not being clear enough.
I'm using runAndRender method to render report as html output and each call birt makes png images on file system. Images (chart images which are linked in html output) which birt produces look like "custom584c4f7913f0fbcb9901.png".
So I would like to be able to set those names (instead of custom*.png) before report is rendered.
mwilliams
I would guess this is something within the source that would have to change, but I could be wrong. Take a look at this file from the source. It appears to name the chart image files:
http://git.eclipse.org/c/birt/org.eclipse.birt.git/tree/chart/org.eclipse.birt.chart.viewer/src/org/eclipse/birt/chart/viewer/internal/util/ChartImageManager.java?h=BIRT_4_2_2_Branch
bkabka
At last I found this useful post:
http://www.eclipse.org/forums/index.php/m/513415/
I wrote CustomImageHandler which extends HTMLServerImageHandler and overrides it's default methods. Instead of calling createUniqueFileName in onCustomImage method, I am able to specify my own name to output images trough constructor's argument . Last step was inserting that handler to html options:
htmlOptions.setImageHandler(new CustomImageHandler("customImageName"));
mwilliams
Great! Glad you got something working! Thanks for updating the thread!