Jump to content
We've recently updated our Privacy Statement, available here ×

iReport variable expression returns null


rkuznetsov
Go to solution Solved by ruthran,

Recommended Posts

Here's the simple code in XML view of print form:

<variable name="TITLE" class="java.lang.String">     <variableExpression><![CDATA[$F{APP_NUMBER}.replaceAll( "app_", "" )]]></variableExpression></variable>[/code]

If I use this variable in form, it returns null (while using "$V{TITLE}"). But if I remove replaceAll method, it works and returns correct value. What is wrong with expression? Should I use something instead of "<variableExpression>"?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

Variable execution depends on which band there were actually placed. Can you let me know where you are placing it. Variable usually return NULL if they were not rendered at proper time. To manipulate this, we also have another called "Evaluation time" on the text box. You can try changing the default value "Now" to some other value and see whether it is working. 

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...