0

I have a dataset in JasperReports report which has two fields ID and Name.

And I want to write Filter Expression for the report itself ie the report should be displayed only if all the Name values on the dataset has string "Success".

Lets say, I have two tuples in the dataset like

Case 1:
(1,'Failure')
(2,'Success')

Case 2:
(1,'Success')
(2,'Success')

Actual Result:
   Case 1 & Case 2: report is displayed

Expected Result:
   Case 1: report should be displayed
   Case 2: report should not be displayed.
My Expression:
   "Success".equals($F{Name}) ? Boolean.TRUE : Boolean.FALSE 

My current expression returns true even if anyone of the Name field has "Success" string.

Hence I need a valid expression which provide me the above expected results.

Please help me.

Rajesh
  • 1,911
  • 1
  • 22
  • 19
  • 1
    And what is your question? – Alex K Nov 18 '13 at 10:55
  • `"Success".equals($F{Name}) ? Boolean.TRUE : Boolean.FALSE` - Your expression looks right – Alex K Nov 18 '13 at 17:43
  • My expression returns true even if anyone of the Name field has "Success". But I want to return true only if values of all Name fields in the dataset have "Success". Or can we get all values of Name field in the dataset? Then I can use it in the expression. like converting the Name field values into ArrayList or something? I found slightly similar kind of requirement in the question http://stackoverflow.com/questions/10997770/reporting-services-join-all-field-on-a-dataset but it is for Sql server reporting services. – Rajesh Nov 19 '13 at 07:00

0 Answers0