Chart report labels do not show up the chart labels in the linux environment [message #643760] |
Wed, 08 December 2010 03:15  |
Eclipse User |
|
|
|
Hi All,
I am generating a bar chart.The bar chart shows up properly when i am generating it in the windows environment.But the same rpt design does not show up the chart labels(i.e. , X-axes labels,Y-axis labels and labels for legends) in the linux environment.
Any suggestions will be really helpful..
[Updated on: Wed, 08 December 2010 03:15] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: Chart report do not show up the chart labels in the linux environment [message #644890 is a reply to message #644865] |
Tue, 14 December 2010 10:51   |
Eclipse User |
|
|
|
What version of BIRT are you using?
If you are using one of the newer versions 2.3-2.6
Replace the HTMLRenderContext code with just this:
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML) ;
options.setOutputStream(resp.getOutputStream());
options.setEmbeddable(true);
options.setImageHandler(new HTMLServerImageHandler());
options.setBaseImageURL(req.getContextPath()+"/images");
options.setImageDirectory(sc.getRealPath("/images"));
create the images directory at the top level of your web app.
req and resp are the request and response objects.
Jason
On 12/14/2010 9:27 AM, srikanth wrote:
> Hi Jason,
>
> It generates in the webviewer. But when I am trying to render in the
> servlet,The graph image does not show up(the title of the graph shows
> up)...
>
> the image src path is
> file:/C:/xampplite/htdocs/myimages/custom7.jpg
>
> I checked the location and the image has been generated in that location.
>
> below is My code for generating the report in HTML
>
>
> HTMLRenderContext renderContext = new HTMLRenderContext();
> renderContext.setBaseURL("http://localhost/");
> //Tell the Engine to prepend all images with this URL - Note this
> requires using the HTMLServerImageHandler
> renderContext.setBaseImageURL("http://localhost/myimages");
> //Tell the Engine where to write the images to
> renderContext.setImageDirectory("C:/xampplite/htdocs/myimages ");
> //Tell the Engine what image formats are supported. Note you must have
> SVG in the string //to render charts in SVG.
> renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
> HashMap<String, HTMLRenderContext> contextMap = new HashMap<String,
> HTMLRenderContext>();
> contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
> renderContext );
> htmlRenderOption.setEnableAgentStyleEngine(true);
> htmlRenderOption.setOutputFormat(HTMLRenderOption.OUTPUT_FOR MAT_HTML);
> htmlRenderOption.setOutputStream(os);
> htmlRenderOption.setEmbeddable(true);
> htmlRenderOption.setOption( IRenderOption.HTML_PAGINATION,
> Boolean.TRUE );
> task.setRenderOption( htmlRenderOption );
> task.setAppContext(contextMap);
> task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOA DER_KEY
> ,ReportBuilder.class.getClassLoader());
>
>
> os = outputstream which I am geting in the servlet as
> (response.getOutputStream(); )
>
> ReportBuilder = it is the class in which the above code has been written
>
> Regards,
> Srikanth
>
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.13848 seconds