birt reports JavaScript conditional expression

8.7k Views Asked by At

I'm trying to get a formula scripted properly, can some one help me please. I'm using Birt 3.7.1. thanks. This is for a Maximo report

if(row["special"] == 'W' && row["metername"] == null){
false} *** I need this coded --don't hide --> must have a task ***

else{

true}



if(row["special"] == 'W' && row["metername"] != null){

false} *** I need this coded --don't hide --> must have task --> view ***

else if(row["special"] == 'W' true

else true}
1

There are 1 best solutions below

1
On

I'm not entirely sure what you're asking here, but if you're looking to just get your code here formatted validly, here you go:

if (row["special"] == 'W' && row["metername"] == null) {
    return false;
} else {
    return true;
}



if (row["special"] == 'W' && row["metername"] != null) {
    return false;
} else if (row["special"] == 'W') {
    return true;
} else {
    return true;
}

I'm not sure its the most practical code, but there you go.