Search code examples
jasper-reports

Getting partial value of a field


How can I grab partial value of field in iReport? for example I got a field

  • Field A contains = "This is a test script, please ignore"
  • I would like to remove "This is a test script, " and just display "please ignore" in my report

Is this possible?


Solution

  • You can simply use the standard string operations upon the field in the expression, like substring, charAt etc. to obtain the string of your requirement in the field.

    For instance :

    $F{myDatafield}.substring(10)
    

    or

    $F{myDatafield}.substring(0,10)  etc.
    

    Whatever suits your cause.