Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » localization file(link dinamically a resource file)
localization file [message #710234] Thu, 04 August 2011 20:58 Go to next message
JulioC Missing name is currently offline JulioC Missing nameFriend
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Hi all

Is there anyway to assign a resource key to a text label dynamically?
Do i need to use a kind of scripting for each label that I need to translate base on the locale of the machine?

Thanks for any input.



Re: localization file [message #710267 is a reply to message #710234] Thu, 04 August 2011 21:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Take a look at this example
http://www.birt-exchange.org/org/devshare/designing-birt-reports/351-localization-of-birt-reports/

You also may want to look at this wiki page:
http://www.birt-exchange.org/org/wiki/index.php?title=BIRT:Internationalization

Jason

On 8/4/2011 4:58 PM, JulioC wrote:
> Hi all
>
> Is there anyway to assign a resource key to a text label dynamically? Do
> i need to use a kind of scripting for each label that I need to
> translate base on the locale of the machine?
>
> Thanks for any input.
>
>
>
>
Re: localization file [message #715220 is a reply to message #710267] Fri, 12 August 2011 19:44 Go to previous messageGo to next message
JulioC Missing name is currently offline JulioC Missing nameFriend
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Thanks Jason
It worked as expected
One more question
It is possible to insert an image dynamically?
We have a report that the only thing changes is the customer, we want to insert dynamically its logo on it.

Thanks
Re: localization file [message #715249 is a reply to message #715220] Fri, 12 August 2011 22:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Take a look at this post:

http://birtworld.blogspot.com/2010/09/birt-image-report-item.html

Jason


On 8/12/2011 3:44 PM, JulioC wrote:
> Thanks Jason
> It worked as expected
> One more question
> It is possible to insert an image dynamically?
> We have a report that the only thing changes is the customer, we want to
> insert dynamically its logo on it.
>
> Thanks
>
Re: localization file [message #717267 is a reply to message #715249] Fri, 19 August 2011 19:11 Go to previous messageGo to next message
JulioC Missing name is currently offline JulioC Missing nameFriend
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Hi Jason Thanks for the link
I was able to do it as this :
1 . this.URI = "file:///C:/eclipsework/myreports/myimage.png";
That was on a windows box, however I couldn't get it working on a linux box, is there any syntax rule for Linux? I tried
this.URI = "report/images/myimage.png" and it does not work (we have birt runtime on a tomcat servlet)
I tried
2. this.URI="http://myhost/report/images/myimage.png" and it worked as expected

We prefer the number 1 idea, it is more flexible when you have the same report for several clients with a different logo, so you can have symlink to myimage.png

Idea number 2 will be great if BIRT can retrieve the hostname of the box so we could have something like this
this.URI="http://${hostname}/report/images/myimage.png"

We want to have only one report design for several clients where the hostname is different.

Thanks in advance for any idea for this.

JulioC.

[Updated on: Fri, 19 August 2011 19:13]

Report message to a moderator

Re: localization file [message #717284 is a reply to message #717267] Fri, 19 August 2011 20:18 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you try a linux uri like:
http://en.wikipedia.org/wiki/File_URI_scheme

Jason

On 8/19/2011 3:11 PM, JulioC wrote:
> Hi Jason Thanks for the link
> I was able to do it as this :
> 1 . this.URI = "file:///C:/eclipsework/myreports/myimage.png"; That was
> on a windows box, however I couldn't get it working on a linux box, is
> there any syntax rule for Linux? I tried this.URI =
> "report/images/myimage.png" and it does not work
> I tried 2. this.URI="http://myhost/report/images/myimage.png" and it
> worked as expected
>
> We prefer the number 1 idea, it is more flexible when you have the same
> report for several clients with a different logo, so you can have
> symlink to myimage.png
> Idea number 2 will be great if BIRT can retrieve the hostname of the box
> so we could have something like this
> this.URI="http://${hostname}/report/images/myimage.png"
>
> We want to have only one report design for several clients where the
> hostname is different.
>
> Thanks in advance for any idea for this.
>
> JulioC.
>
Re: localization file [message #717299 is a reply to message #717284] Fri, 19 August 2011 21:09 Go to previous messageGo to next message
JulioC Missing name is currently offline JulioC Missing nameFriend
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Hi Jason

Thanks a lot
That did the trick.

Re: localization file [message #718212 is a reply to message #717299] Tue, 23 August 2011 15:51 Go to previous messageGo to next message
JulioC Missing name is currently offline JulioC Missing nameFriend
Messages: 33
Registered: March 2011
Location: Ottawa, Canada
Member
Hi Jason
I got the report working using birt viewer on tomcat.

However I have a question, it is possible using javascript to guess the OS of the browser in BIRT?

I was trying to use a normal javascript tool

navigator.appVersion.indexOf("Win")

is there any similar way to do that in BIRT?

Thanks



Re: localization file [message #718225 is a reply to message #718212] Tue, 23 August 2011 16:14 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can do this with client side script. Just add a text element to the
report, set its type to html and enter this code:

<script language="JavaScript">
alert( navigator.appVersion );
</script>

Jason

On 8/23/2011 11:51 AM, JulioC wrote:
> Hi Jason
> I got the report working using birt viewer on tomcat.
>
> However I have a question, it is possible using javascript to guess the
> OS of the browser in BIRT?
>
> I was trying to use a normal javascript tool
>
> navigator.appVersion.indexOf("Win")
>
> is there any similar way to do that in BIRT?
>
> Thanks
>
>
>
>
Re: localization file [message #718226 is a reply to message #718225] Tue, 23 August 2011 16:19 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can always get the user agent header from the request before the
report runs as well:


brw = reportContext.getHttpServletRequest().getHeader("User-Agent");

Jason

On 8/23/2011 12:14 PM, Jason Weathersby wrote:
> You can do this with client side script. Just add a text element to the
> report, set its type to html and enter this code:
>
> <script language="JavaScript">
> alert( navigator.appVersion );
> </script>
>
> Jason
>
> On 8/23/2011 11:51 AM, JulioC wrote:
>> Hi Jason
>> I got the report working using birt viewer on tomcat.
>>
>> However I have a question, it is possible using javascript to guess the
>> OS of the browser in BIRT?
>>
>> I was trying to use a normal javascript tool
>>
>> navigator.appVersion.indexOf("Win")
>>
>> is there any similar way to do that in BIRT?
>>
>> Thanks
>>
>>
>>
>>
>
Previous Topic:Empty data set?
Next Topic:Specifying a path to a Log Directory at run time; Report Viewer App
Goto Forum:
  


Current Time: Tue Apr 16 11:14:11 GMT 2024

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

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

Back to the top