Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Scripting Conditional Formatting(is this possible?)
Scripting Conditional Formatting [message #511955] Wed, 03 February 2010 14:25 Go to next message
jlhernan is currently offline jlhernanFriend
Messages: 13
Registered: November 2009
Junior Member
I was wondering what the syntax is for changing the background color of one of my table rows based on two conditions being true. I know you can do this in the Highlights tab but was having trouble putting two condition, so i decided to try and put it on the script side.

Here is the code. I want something like this.

if(params["param1"].value == "ALL" && dataSetRow["AREA"] == "North")
{
this.getStyle().bgColor = "#FAFAD2"
}

i put this in onRender.

any help is appreciated!!

[Updated on: Wed, 03 February 2010 14:44]

Report message to a moderator

Re: Scripting Conditional Formatting [message #511965 is a reply to message #511955] Wed, 03 February 2010 14:42 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can still use the highlight rule by entering an expression on the left

if( row["ORDERLINENUMBER"] == 9 && row["QUANTITYORDERED"]==41 ){
1;
}else{
0;
}

set the drop down to equal to and put a 1 in the last field.

If you want to do it in script you could do it like (Row oncreate):

if( this.getRowData().getColumnValue("QUANTITYORDERED")==41 &&
this.getRowData().getColumnValue("ORDERLINENUMBER")==9)
{
this.getStyle().backgroundColor = "#FAFAD2"
}

Your reference to a parameter is fine for a condition as well.

Jason


juan436585@yahoo.com wrote:
> I was wondering what the syntax is for changing the background color of
> one of my table rows based on two conditions being true. I know you can
> do this in the Highlights tab but was having trouble putting two
> condition, so i decided to try and put it on the script side.
>
> Here is the code. I want something like this.
>
> if(params["param1"] == "ALL" && dataSetRow["AREA"] == "North")
> {
> this.getStyle().bgColor = "#FAFAD2"
> }
>
> i put this in onRender.
>
> any help is appreciated!!
Re: Scripting Conditional Formatting [message #511970 is a reply to message #511965] Wed, 03 February 2010 14:59 Go to previous messageGo to next message
jlhernan is currently offline jlhernanFriend
Messages: 13
Registered: November 2009
Junior Member
Thanks Jason! That helps tremendously! Quick question though, instead of row["AREA"], can I use something like, dataSetRow["AREA"] == "North"?
Re: Scripting Conditional Formatting [message #511975 is a reply to message #511970] Wed, 03 February 2010 15:11 Go to previous message
jlhernan is currently offline jlhernanFriend
Messages: 13
Registered: November 2009
Junior Member
Never mind. I got it to work correctly.

Once again, thanks Jason!
Previous Topic:BIRT throws NullPointerException
Next Topic:CrossTab Row-wise aggrigation
Goto Forum:
  


Current Time: Thu Apr 25 06:38:39 GMT 2024

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

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

Back to the top