Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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
Paul Ramsden is currently offline Paul Ramsden
Messages: 79
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 12:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
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 52 times)


Jason Weathersby

BIRT Exchange
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
Jason Weathersby is currently offline Jason Weathersby
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 52 times)


Jason Weathersby

BIRT Exchange
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
Jason Weathersby is currently offline Jason Weathersby
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 55 times)


Jason Weathersby

BIRT Exchange
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
Jason Weathersby is currently offline Jason Weathersby
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 58 times)


Jason Weathersby

BIRT Exchange
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
Jason Weathersby is currently offline Jason Weathersby
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 51 times)


Jason Weathersby

BIRT Exchange
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
Jason Weathersby is currently offline Jason Weathersby
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 46 times)


Jason Weathersby

BIRT Exchange
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
Jason Weathersby is currently offline Jason Weathersby
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?
>>
>
>


Jason Weathersby

BIRT Exchange
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 user Chennai is currently offline Eclipse user Chennai
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 14:45 Go to previous messageGo to next message
Eclipse user Chennai is currently offline Eclipse user Chennai
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 00:33 Go to previous messageGo to next message
Paul Ramsden is currently offline Paul Ramsden
Messages: 79
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 10:18 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
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?


Jason Weathersby

BIRT Exchange
Previous Topic:Birt Memory Usage
Next Topic:'Internal error' when opening PDF preview window
Goto Forum:
  


Current Time: Thu Apr 17 05:42:48 EDT 2014

Powered by FUDForum. Page generated in 0.02100 seconds