jrubino Posted February 11, 2019 Share Posted February 11, 2019 I have a descrption field from a table that contains the word/value Offset. After Offset is a 2 char value that I need to extract for priting on my iReport.Here is my feild data: WD2.FD906: Offset SQ. 1 X 3-1/16 L:0 B:1-7/8 & SQ. 1-9/16 X 4-5/16 L:3/8 B:0 - FlexThe value I need to extract is the SQ. This value is not in the same position, it could be in a position less or more than it shows here, BUT it is always after the value Offset. Link to comment Share on other sites More sharing options...
Solution akovach Posted February 13, 2019 Solution Share Posted February 13, 2019 Hi,If your field is java.lang.String type use $F{field}.substring(startIndex, endIndex)Otherwise, use $F{field}.toString().substring(startIndex, endIndex)In usecase from question it will be:$F{field}.substring(18, 21) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now