Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to use charAt() in a highlight expression?
How to use charAt() in a highlight expression? [message #891888] Tue, 26 June 2012 12:42 Go to next message
Paul Ramsden is currently offline Paul RamsdenFriend
Messages: 84
Registered: February 2011
Location: BW, Germany
Member
I have been trying to use the following expression in a highlight rule.

row["Status"].charAt(0) equalTo '1'


It never seems to work.

I also tried

new String(row["Status"]).charAt(0) equalTo '1'

row["Status"].charAt(0) == '1' IsTrue


... no luck

Am I doing something wrong here?


On a related point:
I believe that the data is correct but I would like to debug this or spit out some kind of trace to make sure. How could I do this?
Re: How to use charAt() in a highlight expression? [message #891943 is a reply to message #891888] Tue, 26 June 2012 16:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Is row["Status"] a string? Take a look at the attached example. Select
the product code and see the highlight rule.

Jason

On 6/26/2012 8:42 AM, Paul Ramsden wrote:
> I have been trying to use the following expression in a highlight rule.
>
>
> row["Status"].charAt(0) equalTo '1'
>
>
> It never seems to work.
>
> I also tried
>
>
> new String(row["Status"]).charAt(0) equalTo '1'
>
> row["Status"].charAt(0) == '1' IsTrue
>
>
> ... no luck
>
> Am I doing something wrong here?
>
>
> On a related point:
> I believe that the data is correct but I would like to debug this or
> spit out some kind of trace to make sure. How could I do this?
>
  • Attachment: charat.zip
    (Size: 2.44KB, Downloaded 186 times)
Re: How to use charAt() in a highlight expression? [message #891945 is a reply to message #891888] Tue, 26 June 2012 16:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Is row["Status"] a string? Take a look at the attached example. Select
the product code and see the highlight rule.

Jason

On 6/26/2012 8:42 AM, Paul Ramsden wrote:
> I have been trying to use the following expression in a highlight rule.
>
>
> row["Status"].charAt(0) equalTo '1'
>
>
> It never seems to work.
>
> I also tried
>
>
> new String(row["Status"]).charAt(0) equalTo '1'
>
> row["Status"].charAt(0) == '1' IsTrue
>
>
> ... no luck
>
> Am I doing something wrong here?
>
>
> On a related point:
> I believe that the data is correct but I would like to debug this or
> spit out some kind of trace to make sure. How could I do this?
>
  • Attachment: charat.zip
    (Size: 2.44KB, Downloaded 157 times)
Re: How to use charAt() in a highlight expression? [message #891947 is a reply to message #891888] Tue, 26 June 2012 16:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Is row["Status"] a string? Take a look at the attached example. Select
the product code and see the highlight rule.

Jason

On 6/26/2012 8:42 AM, Paul Ramsden wrote:
> I have been trying to use the following expression in a highlight rule.
>
>
> row["Status"].charAt(0) equalTo '1'
>
>
> It never seems to work.
>
> I also tried
>
>
> new String(row["Status"]).charAt(0) equalTo '1'
>
> row["Status"].charAt(0) == '1' IsTrue
>
>
> ... no luck
>
> Am I doing something wrong here?
>
>
> On a related point:
> I believe that the data is correct but I would like to debug this or
> spit out some kind of trace to make sure. How could I do this?
>
  • Attachment: charat.zip
    (Size: 2.44KB, Downloaded 160 times)
Re: How to use charAt() in a highlight expression? [message #891949 is a reply to message #891888] Tue, 26 June 2012 16:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Is row["Status"] a string? Take a look at the attached example. Select
the product code and see the highlight rule.

Jason

On 6/26/2012 8:42 AM, Paul Ramsden wrote:
> I have been trying to use the following expression in a highlight rule.
>
>
> row["Status"].charAt(0) equalTo '1'
>
>
> It never seems to work.
>
> I also tried
>
>
> new String(row["Status"]).charAt(0) equalTo '1'
>
> row["Status"].charAt(0) == '1' IsTrue
>
>
> ... no luck
>
> Am I doing something wrong here?
>
>
> On a related point:
> I believe that the data is correct but I would like to debug this or
> spit out some kind of trace to make sure. How could I do this?
>
  • Attachment: charat.zip
    (Size: 2.44KB, Downloaded 170 times)
Re: How to use charAt() in a highlight expression? [message #891951 is a reply to message #891888] Tue, 26 June 2012 16:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Is row["Status"] a string? Take a look at the attached example. Select
the product code and see the highlight rule.

Jason

On 6/26/2012 8:42 AM, Paul Ramsden wrote:
> I have been trying to use the following expression in a highlight rule.
>
>
> row["Status"].charAt(0) equalTo '1'
>
>
> It never seems to work.
>
> I also tried
>
>
> new String(row["Status"]).charAt(0) equalTo '1'
>
> row["Status"].charAt(0) == '1' IsTrue
>
>
> ... no luck
>
> Am I doing something wrong here?
>
>
> On a related point:
> I believe that the data is correct but I would like to debug this or
> spit out some kind of trace to make sure. How could I do this?
>
  • Attachment: charat.zip
    (Size: 2.44KB, Downloaded 167 times)
Re: How to use charAt() in a highlight expression? [message #891953 is a reply to message #891888] Tue, 26 June 2012 16:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Is row["Status"] a string? Take a look at the attached example. Select
the product code and see the highlight rule.

Jason

On 6/26/2012 8:42 AM, Paul Ramsden wrote:
> I have been trying to use the following expression in a highlight rule.
>
>
> row["Status"].charAt(0) equalTo '1'
>
>
> It never seems to work.
>
> I also tried
>
>
> new String(row["Status"]).charAt(0) equalTo '1'
>
> row["Status"].charAt(0) == '1' IsTrue
>
>
> ... no luck
>
> Am I doing something wrong here?
>
>
> On a related point:
> I believe that the data is correct but I would like to debug this or
> spit out some kind of trace to make sure. How could I do this?
>
  • Attachment: charat.zip
    (Size: 2.44KB, Downloaded 193 times)
Re: How to use charAt() in a highlight expression? [message #891954 is a reply to message #891943] Tue, 26 June 2012 16:03 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Also may want to put a check in for null, because this will most likely
cause the highlight to fail.

Jason

On 6/26/2012 12:02 PM, Jason Weathersby wrote:
> Is row["Status"] a string? Take a look at the attached example. Select
> the product code and see the highlight rule.
>
> Jason
>
> On 6/26/2012 8:42 AM, Paul Ramsden wrote:
>> I have been trying to use the following expression in a highlight rule.
>>
>>
>> row["Status"].charAt(0) equalTo '1'
>>
>>
>> It never seems to work.
>>
>> I also tried
>>
>>
>> new String(row["Status"]).charAt(0) equalTo '1'
>>
>> row["Status"].charAt(0) == '1' IsTrue
>>
>>
>> ... no luck
>>
>> Am I doing something wrong here?
>>
>>
>> On a related point:
>> I believe that the data is correct but I would like to debug this or
>> spit out some kind of trace to make sure. How could I do this?
>>
>
>
Re: How to use charAt() in a highlight expression? [message #891986 is a reply to message #891888] Tue, 26 June 2012 18:44 Go to previous messageGo to next message
Eclipse user Chennai is currently offline Eclipse user ChennaiFriend
Messages: 15
Registered: May 2011
Junior Member
Have you tried like this?

(row["Status"] != null) && (row["Status"].charAt(0) == '1')


Re: How to use charAt() in a highlight expression? [message #891987 is a reply to message #891888] Tue, 26 June 2012 18:45 Go to previous messageGo to next message
Eclipse user Chennai is currently offline Eclipse user ChennaiFriend
Messages: 15
Registered: May 2011
Junior Member
Have you tried like this?

(row["Status"] != null) && (row["Status"].charAt(0) == '1')
(or)
(row["Status"] != null) && (row["Status"].charAt(0) == "1")
Re: How to use charAt() in a highlight expression? [message #892063 is a reply to message #891987] Wed, 27 June 2012 04:33 Go to previous messageGo to next message
Paul Ramsden is currently offline Paul RamsdenFriend
Messages: 84
Registered: February 2011
Location: BW, Germany
Member
Thanks for the replies.

I am pretty certain that the value is a string and is not null. The string is always 2 chars, xy, where x indicates attendance (0 or 1) and y is the role (., M, B or X). The role is output as text in the cell. The attendance is used highlight the cell (change background colour).

The role value does appear correctly using normal data binding (e.g. dataSetRow["Day1"].charAt(1))

Is it possible to debug javascript?
Re: How to use charAt() in a highlight expression? [message #892520 is a reply to message #892063] Thu, 28 June 2012 14:18 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Paul

I am not certain why this happening. Can you reproduce with the sample db?

Jason


On 6/27/2012 12:33 AM, Paul Ramsden wrote:
> Thanks for the replies.
>
> I am pretty certain that the value is a string and is not null. The
> string is always 2 chars, xy, where x indicates attendance (0 or 1) and
> y is the role (., M, B or X). The role is output as text in the cell.
> The attendance is used highlight the cell (change background colour).
>
> The role value does appear correctly using normal data binding (e.g.
> dataSetRow["Day1"].charAt(1))
>
> Is it possible to debug javascript?
Previous Topic:Birt Memory Usage
Next Topic:'Internal error' when opening PDF preview window
Goto Forum:
  


Current Time: Thu Apr 25 02:09:02 GMT 2024

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

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

Back to the top