Hi all - I'm new to using Jaspersoft, and am having some trouble understanding the operation of the Expresion Editor in Studio 6.6 - especially for expressions with multiple parts - such as an 'If - Else'.
The editor brings up three boxes for the three parts (condition - action if true - action if false), and it seems to be stable as long as each of the three has correct syntax. However being new, I am still coming to terms with how to use the interface, and find that when I get one of the boxes wrong - I end up losing the whole statement and have to start again. I got so frustrated with it last night, that I resoted to hacking the XML code instead of using the Expression Editor.
Is there a good 'in-dpeth' resource to help familiarise me with this tool, that explains its use with more complex expressions, and combining expressions, etc? As an example - one of the tasks I am trying to do is pull the first name out of a user name field, where that field may have just one name, or multiple names separated by a space. So I have a Variable called 'FirstName' configured with the expression...
IF($F{NAMES}.indexOf(" ") == -1, $F{NAMES}, $F{NAMES}.substring(0,$F{NAMES}.indexOf(" ")))
The last element of this expression is causing me problems (any help with that would be greatly appreciated), but each time I try something new in that element via the Expression Editor - I end up losing the rest of the expression and just my new trial code being left in its place. I am sure it is simply down to my understanding of the product and lack of experience - but it is sure getting frustrating. Any advice would be greatly appreciated.
Thanks in advance
Graham