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)
Size of Chart's image is reduced
manojsanjo
Hi,
I have a web application in which only RunTime Engine(RE) is used. In my report file, I have inserted a chart and is displayed like how I want when previewed (4.5in x 5in). Now when I run my webapp, the chart is saved as an image and then rendered on the HTML page. At this point, the size of the image is very small (2in x 2in).
Any clue?
Thanks,
Manoj.
Find more posts tagged with
Comments
JasonW
What verison of BIRT are you using? Are you setting the chart dpi in your RE API code?
config.getAppContext().put( EngineConstants.APPCONTEXT_CHART_RESOLUTION, 120 );
You may want to try different settings ie 96, 300
There is also an advanced property in the report that stores the image dpi. Just click the report canvas and then look at the advanced tab in the properties editor.
One last thing. Is the report layout set to fixed or auto?
Jason
manojsanjo
Hi Jason,<br />
<br />
1) The plugin is 3.7.0, and the jar used in webapp is 2.6<br />
2) During design time (in Eclipse), no matter how I resize the image, the preview looks good, but when it come to viewing on webapp, it is always a constant size. This is a problem. Is there something (like an API) I should search for that could cause this. Also FYI, I do not see anywhere in code where EngineConstants.APPCONTEXT_CHART_RESOLUTION is used.<br />
<br />
I have written code like the following to set image URL.<br />
HTMLRenderOption renderOption = new HTMLRenderOption();<br />
renderOption.setEmbeddable(true);<br />
renderOption.setHtmlPagination(false);<br />
renderOption.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);<br />
renderOption.setOutputStream(buffer);<br />
renderOption.setImageHandler(new HTMLServerImageHandler();<br />
renderOption.setBaseImageURL("<a class='bbc_url' href='
http://localhost:8080/myapp/birtimages/'>http://localhost:8080/myapp/birtimages/"</a>);<br
/>
renderOption.setImageDirectory(sc.getRealPath(sc.getInitParameter("BIRT_VIEWER_IMAGE_DIR")));<br />
<br />
In here, I do not set any image size, but I am wondering how & where the chart is created into an image, and if at that place the size is set. How can I find it out? Is it something internal to the ReportEngine API?<br />
<br />
Thanks for your help in advance.<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="81372" data-time="1312950591" data-date="09 August 2011 - 09:29 PM"><p>
What verison of BIRT are you using? Are you setting the chart dpi in your RE API code?<br />
<br />
config.getAppContext().put( EngineConstants.APPCONTEXT_CHART_RESOLUTION, 120 );<br />
You may want to try different settings ie 96, 300<br />
<br />
There is also an advanced property in the report that stores the image dpi. Just click the report canvas and then look at the advanced tab in the properties editor.<br />
<br />
One last thing. Is the report layout set to fixed or auto?<br />
<br />
Jason<br /></p></blockquote>
JasonW
Is the report designed with 3.7? If so that will most likely cause issues if the web app viewer is version 2.6.2.
When you create your engine config you set the chart resolution like the above code:
EngineConfig config = new EngineConfig();
config.getAppContext().put( EngineConstants.APPCONTEXT_CHART_RESOLUTION, 120 );
In the render options you can set the supported image formats like:
renderOptions.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
Also check the report design. Is it fixed or auto layout?
Jason
manojsanjo
I am having fixed-layout.<br />
I have tried to use "config.getAppContext().put( EngineConstants.APPCONTEXT_CHART_RESOLUTION, 120 );", but still no change.<br />
Now I am working to get the 2.6 plugin for Eclipse....and will see if the problem persists.<br />
<br />
Manoj.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="81422" data-time="1312998175" data-date="10 August 2011 - 10:42 AM"><p>
Is the report designed with 3.7? If so that will most likely cause issues if the web app viewer is version 2.6.2. <br />
<br />
When you create your engine config you set the chart resolution like the above code:<br />
<br />
EngineConfig config = new EngineConfig();<br />
config.getAppContext().put( EngineConstants.APPCONTEXT_CHART_RESOLUTION, 120 );<br />
<br />
In the render options you can set the supported image formats like:<br />
renderOptions.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");<br />
<br />
Also check the report design. Is it fixed or auto layout?<br />
<br />
Jason<br /></p></blockquote>
JasonW
Ok. I am not certain what is happening. Post your results when you test 2.6.
Jason
manojsanjo
i Jason,<br />
<br />
I have now v2.6 as my Eclipse plugin and my ReportEngine.<br />
I am attaching couple of images that explains my situation. Notice how the image is small in the 2nd. I tried to resize chart in the designer snall to big...and still the output size is always constant.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="81426" data-time="1313000274" data-date="10 August 2011 - 11:17 AM"><p>
Ok. I am not certain what is happening. Post your results when you test 2.6.<br />
<br />
Jason<br /></p></blockquote>
manojsanjo
Jason,
I noticed that when I give
config.getAppContext().put( EngineConstants.APPCONTEXT_CHART_RESOLUTION, 350 );
...the image that is generated in the local folder is bigger (the size I was looking for), but the webpage shows a smaller image.
JasonW
Any chance you can pull the chart out of the table as a test? Just put it by itself.
Jason
manojsanjo
Jason,<br />
Using Javascript, as mentioned here (<a class='bbc_url' href='
http://birtworld.blogspot.com/2008/04/birt-resizing-charts.html'>http://birtworld.blogspot.com/2008/04/birt-resizing-charts.html</a>)
, I was able to resize the chart. But I am facing some limitations on how much I can increase. Well, I am conducting more tests and hopefully should get there soon...
<br />
<br />
Thanks!<br />
<br />
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="81479" data-time="1313071617" data-date="11 August 2011 - 07:06 AM"><p>
Any chance you can pull the chart out of the table as a test? Just put it by itself.<br />
<br />
Jason<br /></p></blockquote>