Skip to main content



      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 08:42 Go to next message
Eclipse UserFriend
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 12:02 Go to previous messageGo to next message
Eclipse UserFriend
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 216 times)
Re: How to use charAt() in a highlight expression? [message #891945 is a reply to message #891888] Tue, 26 June 2012 12:02 Go to previous messageGo to next message
Eclipse UserFriend
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 182 times)
Re: How to use charAt() in a highlight expression? [message #891947 is a reply to message #891888] Tue, 26 June 2012 12:02 Go to previous messageGo to next message
Eclipse UserFriend
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 192 times)
Re: How to use charAt() in a highlight expression? [message #891949 is a reply to message #891888] Tue, 26 June 2012 12:02 Go to previous messageGo to next message
Eclipse UserFriend
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 197 times)
Re: How to use charAt() in a highlight expression? [message #891951 is a reply to message #891888] Tue, 26 June 2012 12:02 Go to previous messageGo to next message
Eclipse UserFriend
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 191 times)
Re: How to use charAt() in a highlight expression? [message #891953 is a reply to message #891888] Tue, 26 June 2012 12:02 Go to previous messageGo to next message
Eclipse UserFriend
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 238 times)
Re: How to use charAt() in a highlight expression? [message #891954 is a reply to message #891943] Tue, 26 June 2012 12:03 Go to previous messageGo to next message
Eclipse UserFriend
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 14:44 Go to previous messageGo to next message
Eclipse UserFriend
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 14:45 Go to previous messageGo to next message
Eclipse UserFriend
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 00:33 Go to previous messageGo to next message
Eclipse UserFriend
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 10:18 Go to previous message
Eclipse UserFriend
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: Sat Jul 12 10:00:16 EDT 2025

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

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

Back to the top