Jump to content
Changes to the Jaspersoft community edition download ×

Insert a condition


Gefrey

Recommended Posts

Hello i'm french so sorry for my english.

I'm trying to add a condition in an expression.

the expression is:

new Boolean((($F{TYPE}.equals("T2T")))?true:(($F{INTERNAL_PARTY}.substring(0,3)).startsWith("9660") && $F{CALLING_PARTY}.length()>4)?true:($F{INTERNAL_PARTY}.matches("[\d]{4,4}"))?true:false)

 

and i want to delete all the field that have more of 4 characters thanks to this condition:

 

$F{CALLING_PARTY}).length()>4

 

but i got problem with the insertion. i'm new in ireport.

If somebody can help me...

Thanks

Geoffrey

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

This code compiles...

 

Code:
new Boolean(
( ($F{TYPE}.equals("T2T"«»))
? true :
( (($F{INTERNAL_PARTY}.substring(0,3)).startsWith("9660"«») &&
$F{CALLING_PARTY}.length()>4 )
? true :
( ( $F{INTERNAL_PARTY}.matches("something"«») )
? true :
false
)
)
) && ! ( ($F{CALLING_PARTY}).length()>4 )
)

 

...but

 

Code:
[code]$F{INTERNAL_PARTY}.substring(0,3)).startsWith("9660"«»)

 

is always FALSE;

 

"[d]{4,4}" is not a valid java string

 

$F{CALLING_PARTY}.length()>4 is required TRUE AND FALSE at the same time...

 

Giulio

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...