Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Localization with SubString(How to combine SubString with localized content)
Localization with SubString [message #1838564] Mon, 01 March 2021 14:41 Go to next message
Uwe Stieglitz is currently offline Uwe StieglitzFriend
Messages: 3
Registered: March 2021
Junior Member
Dear All,

I am stuck with the following:

In the SQL of my report I am calling "CPNT_TITLE AS TITLE1", which is the title of training I am looking.
"CPNT_TITLE1" is localized, and when I use in BIRT expression builder the expression "reportContext.getMessage("TITLE1", reportContext.getLocale())", then everything works fine.

But now I have the requirement that the title shall be displayed not in full length in one column, but distributed over max. 4 columns of max. 30 characters.

No problem I though, I use "substring.(...)". But I do not get it working in combination with the localization.

When I am using the substring in the SQL script and the localization in the BIRT expression builder, then only 1 of the 4 fields is filled and the localization does not work (only random characters...).

When I try combining the localization and the substring in the expression builder like "reportContext.getMessage(dataSetRow["TITEL1"], reportContext.getLocale().substr(0,30))", then the HTML preview of BIRT gives me an error: "TypeError: Cannot find function substr in object de_DE. "

When I am using substring in the BIRT expression builder without localization, I still get an error: "TypeError: Cannot call method "substring" of null".

I tried then to get rid of possible NULL values by using "COALESCE" but it did neither work in SQL nor in expression builder.

Does anyone have a suggestion? I would appreciate...

Thanks Uwe
Re: Localization with SubString [message #1838684 is a reply to message #1838564] Wed, 03 March 2021 14:10 Go to previous message
Uwe Stieglitz is currently offline Uwe StieglitzFriend
Messages: 3
Registered: March 2021
Junior Member
Hi,

I am 1 step further now:
For the first column - looking for the first 30 characters of the title string - I am using:

BirtStr.left((reportContext.getMessage(dataSetRow["TITLE1"], reportContext.getLocale())),30)

This works fine.

But I still don't manage to define the right exprission for the second column, which is looking for the string from 31 to 60. Since the length of the title can by anything between 1 and 100 characters, I do not get the right expression.

Hoping for your ideas...

Uwe
Previous Topic:Unable to Pass Parameter in URL
Next Topic:Birt Sorting
Goto Forum:
  


Current Time: Thu May 02 00:24:05 GMT 2024

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

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

Back to the top