Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Chart report labels do not show up the chart labels in the linux environment(Chart report labels do not show up the chart labels in the linux environment)  () 1 Vote
Chart report labels do not show up the chart labels in the linux environment [message #643760] Wed, 08 December 2010 08:15 Go to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
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 08:15]

Report message to a moderator

Re: Chart report do not show up the chart labels in the linux environment [message #643911 is a reply to message #643760] Wed, 08 December 2010 16:44 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you give some more detail on how you are generating it?
Are you using your own servlet or using the webviewer?

Jason

On 12/8/2010 3:15 AM, srikanth wrote:
> 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..
Re: Chart report do not show up the chart labels in the linux environment [message #644020 is a reply to message #643911] Thu, 09 December 2010 06:02 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
Hi Jason,

These are the details below:

1) I am using My own servlet
2)The enivironment is linux
3)Open jdk version 1.6.x
4)I am rendering the response on the servlet.
5)Birt version I am using is 2.6.0

below is the code of the report rendering,


ReportEngine engine = null;
IReportRunnable report = null;
engine = BIRTEngineFactory.getReportEngine("C:\birt-runtime-2_6_0\birt-runtime-2_6_0\ReportEngine ");
report = engine.openReportDesign("C:\MyReport.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask( report );
RenderOption options = new RenderOption( );

options.setOption(IPDFRenderOption.PAGE_OVERFLOW,
IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES);
options.setOutputStream(os);
task.setRenderOption( options );
try{
//System.out.println("beforeeeeeeeee run");
task.run();
//System.out.println("aftreeeeeeee run");

}catch ( EngineException e1 )
{
e1.printStackTrace();
System.err.println( "Report " + name + " run failed.\n" );
//System.err.println( e1.toString( ) );
}

regards,
Srikanth

[Updated on: Thu, 09 December 2010 11:36]

Report message to a moderator

Re: Chart report do not show up the chart labels in the linux environment [message #644176 is a reply to message #644020] Thu, 09 December 2010 17:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Do you set the supported image formats in the servlet?
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFormat("html");
options.setImageDirectory(sc.getRealPath("/Images"));
options.setBaseImageURL(request.getContextPath()+"/Images");
options.setSupportedImageFormats("JPG;PNG;BMP;SVG");


Look at the generated html and look for the img src tag. Verify the
image gets created.

Jason

On 12/9/2010 1:02 AM, srikanth wrote:
> Hi Jason,
>
>
> I am using My own servlet.....
>
> regards,
> Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #644260 is a reply to message #644176] Fri, 10 December 2010 09:51 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
hi Jason,

I am generating the report in pdf format... And the graph renders properly for pdf on windows But that is not in linux..

I dont think we need to use the following piece of code for generating it in pdf..

options.setImageDirectory(sc.getRealPath("/Images"));
options.setBaseImageURL(request.getContextPath()+"/Images");
options.setSupportedImageFormats("JPG;PNG;BMP;SVG");


Regards,
Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #644322 is a reply to message #644260] Fri, 10 December 2010 14:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Are you getting anything in the log?
Can you try html and see if it is creating the images?

Jason

On 12/10/2010 4:51 AM, srikanth wrote:
> hi Jason,
>
> I am generating the report in pdf format... And the graph renders
> properly for pdf on windows But that is not in linux..
>
> I dont think we need to use the following piece of code for generating
> it in pdf..
>
> options.setImageDirectory(sc.getRealPath("/Images"));
> options.setBaseImageURL(request.getContextPath()+"/Images");
> options.setSupportedImageFormats("JPG;PNG;BMP;SVG");
>
> Regards,
> Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #644625 is a reply to message #644322] Mon, 13 December 2010 14:21 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
Hi Jason,

I tried generating in HTML and it does generate images in the location I have specified.The report shows the graph image location correctly when viewed the of the My HTML source code.But the graph image is not showing up..This is happening in both windows and Linux..

Regards,
Srikanth

Re: Chart report do not show up the chart labels in the linux environment [message #644660 is a reply to message #644625] Mon, 13 December 2010 16:41 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you post what the img src tag is showing? Do you get anything in
the log file?

Jason

On 12/13/2010 9:21 AM, srikanth wrote:
> Hi Jason,
>
> I tried generating in HTML and it does generate images in the location I
> have specified.The report shows the graph image location correctly when
> viewed the of the My HTML source code.But the graph image is not showing
> up..This is happening in both windows and Linux..
>
> Regards,
> Srikanth
>
>
Re: Chart report do not show up the chart labels in the linux environment [message #644661 is a reply to message #644660] Mon, 13 December 2010 16:42 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Also as a test can you deploy the web viewer and see if html and pdf
show the report?

Jason

On 12/13/2010 11:41 AM, Jason Weathersby wrote:
> Can you post what the img src tag is showing? Do you get anything in
> the log file?
>
> Jason
>
> On 12/13/2010 9:21 AM, srikanth wrote:
>> Hi Jason,
>>
>> I tried generating in HTML and it does generate images in the location I
>> have specified.The report shows the graph image location correctly when
>> viewed the of the My HTML source code.But the graph image is not showing
>> up..This is happening in both windows and Linux..
>>
>> Regards,
>> Srikanth
>>
>>
>
Re: Chart report do not show up the chart labels in the linux environment [message #644865 is a reply to message #644661] Tue, 14 December 2010 14:27 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
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
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 15:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

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
>
Re: Chart report do not show up the chart labels in the linux environment [message #645170 is a reply to message #644890] Wed, 15 December 2010 18:51 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
Hi Jason,

It worked in both linux and windows environment....Thank you very much...Smile

But any idea why was it behaving differently in linux and windows environment for report in pdf format?

Regards,
Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #645174 is a reply to message #645170] Wed, 15 December 2010 19:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I am not certain what is happening. If you use the viewer and export to
pdf on linux does it work?

Jason

On 12/15/2010 1:51 PM, srikanth wrote:
> Hi Jason,
>
> It worked in both linux and windows environment....Thank you very much...:)
>
> But any idea why was it behaving differently in linux and windows
> environment for report in pdf format?
>
> Regards,
> Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #645318 is a reply to message #645174] Thu, 16 December 2010 16:00 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
Hi Jason,

It generates the graph in pdf correctly when i generate it through webviewer..

Regards,
Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #645367 is a reply to message #645318] Thu, 16 December 2010 18:41 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

What is the chart formatted in? SVG? if so try png.

Jason

On 12/16/2010 11:00 AM, srikanth wrote:
> Hi Jason,
>
> It generates the graph in pdf correctly when i generate it through
> webviewer..
>
> Regards,
> Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #645785 is a reply to message #645367] Mon, 20 December 2010 15:19 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
Hi Jason,

I have one issue generating chart in HTML.

Every time I generate chart(in HTML),I have to create an image of the graph and store in My hard disk.Is there any way I can render the graph in the HTML without creating the image(like the way it does for the chart in the PDF format)..

Regards,
Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #645812 is a reply to message #645785] Mon, 20 December 2010 16:35 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are using the Chart Engine this can be done, but with the BIRT
report engine I do not know of a way. You could look at the
IHTMLImageHandler interface, but most of the methods return strings.
This is the interface that the HTMLServerImageHandler class implements.
When the engine runs it creates the file and sets up an image map to
handle interactivity which works with the img src tag in HTML. Could
you write a shell script to cleanup the files periodically?

Jason

On 12/20/2010 10:19 AM, srikanth wrote:
> Hi Jason,
>
> I have one issue generating chart in HTML.
>
> Every time I generate chart(in HTML),I have to create an image of the
> graph and store in My hard disk.Is there any way I can render the graph
> in the HTML without creating the image(like the way it does for the
> chart in the PDF format)..
>
> Regards,
> Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #646132 is a reply to message #645812] Wed, 22 December 2010 09:39 Go to previous messageGo to next message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
Hi Jason,


Is it possible to use engine based on the type of report (PDF,HTML,word doc) I want to genrate?

Regards,
Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #646179 is a reply to message #646132] Wed, 22 December 2010 14:54 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Not sure what you need here, but you could add a jsp to the viewer that
is called before going to the viewer. The JSP could check the format
and then forward to either the viewer or another servlet which uses the
engine.

Jason

On 12/22/2010 4:39 AM, srikanth wrote:
> Hi Jason,
>
>
> Is it possible to use engine based on the type of report (PDF,HTML,word
> doc) I want to genrate?
>
> Regards,
> Srikanth
Re: Chart report do not show up the chart labels in the linux environment [message #646432 is a reply to message #646179] Fri, 24 December 2010 06:38 Go to previous message
srikanth Mising name is currently offline srikanth Mising name
Messages: 38
Registered: July 2010
Member
Hi Jason,

Just wanted to update on the labels not showing in Linux environment for PDF format.

I tried with the chart as PNG and its working fine in both windows and linux environment...

Thankss again...
Smile
Previous Topic:The selected driver cannot parse the given JNDI Data Source URL.
Next Topic:Iportal problem
Goto Forum:
  


Current Time: Thu Oct 23 15:28:20 GMT 2014

Powered by FUDForum. Page generated in 0.03258 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software