How to hide a row in a table using a regulare expression in birt report

28 Views Asked by At

Im trying to hide a row in table using a regular expression in birt report but i can't figure it out. in fact im testing if a row equal to an expression that contain "tourn" but i dont know how: enter image description here

Any ideas

I already tested this row["type_collecte"] != new RegExp('/Tourn/')

1

There are 1 best solutions below

0
On

One solution is to go out of the javascript and use plain java within the report. The following expression could be used as visibility condition in your case:

result = "";
tc = row["type_collecte"];
try{
    if (tc != null) {
        myJavaString = new java.lang.String(tc);
        result = myJavaString.matches("(.*)Tourn(.*)");
    }    
} catch(error) {}
result;

It's not tested with null. I checked it with these examples:

123123
x-Tourn-x
y-tourn-y
zzzzzz

My BIRT Report designer 4.13.0 hides for these examples the row with x-Tourn-x:

123123
y-tourn-y
zzzzzz