ye_l Posted March 12, 2019 Share Posted March 12, 2019 In the Print when Expression field, I put the following condition to show or hide the frame:IF((($F{imp_item_revision_id_1}.isEmpty()==false) || ($F{sol_item_revision_id_1}.isEmpty()==false)), Boolean.TRUE,Boolean.FALSE)If one of the two conditions is true, the frame should be displayed.But if the first is false and the second is true, in this case the frame disappears. I dont understand why? Link to comment Share on other sites More sharing options...
C-Box Posted March 12, 2019 Share Posted March 12, 2019 Why so complex syntax? Just try:!$F{imp_item_revision_id_1}.isEmpty() || !$F{sol_item_revision_id_1}.isEmpty()[/code]for your printWhenExpression to let the frame printed when one of the two field isn't emptyBe aware if the field contents are null ... then you could use apache StringUtils.isNotEmpty Method that is "null-safe":eg:StringUtils.isNotEmpty($F{imp_item_revision_id_1}) || StringUtils.isNotEmpty($F{sol_item_revision_id_1})[/code]hth + regardsC-Box Link to comment Share on other sites More sharing options...
hozawa Posted March 12, 2019 Share Posted March 12, 2019 It may be that you have a null in $F{sol_item_v}. This will cause .isEmpty() to be null so the condition would be false.Try this.Objects.nonNull($F{imp_item_revision_id_1}) && Objects.nonNull($F{sol_item_revision_id_1}) && ($F{imp_item_revision_id_1}.length() + $F{sol_item_revision_id_1}.length() > 0) Link to comment Share on other sites More sharing options...
ye_l Posted April 24, 2019 Author Share Posted April 24, 2019 Hello C-Box, hello hozawa,thank you very much for your help. Your suggestions have helped me a lot!best regardsyel 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