richard_07 Posted August 1, 2007 Share Posted August 1, 2007 Hello to all, recently I start work with iReport.So, my question is: I want to evaluate a field when this is printed with respect the previous field printed. Depending the value i show it or not. I mean, for example if the value of that field is equals to the previus i dont show it. I hope that you can understand me, my english is not very good but i try to searchinformation in the web about my problem and i dont find any solution for that reason it is that i ask to you. Thank you very much. Link to comment Share on other sites More sharing options...
codyjasperForge Posted August 1, 2007 Share Posted August 1, 2007 Is this what you are asking?You have two fields... $F{f1} = value $F{f2} -> Print when expression = new Boolean ($F{f2}.equals($F{f1})) Link to comment Share on other sites More sharing options...
richard_07 Posted August 1, 2007 Author Share Posted August 1, 2007 In my report I print several times the same field, it is necessary so if the previous field printed is equals to the following one i dont show it (the following). Link to comment Share on other sites More sharing options...
codyjasperForge Posted August 1, 2007 Share Posted August 1, 2007 You could create a variable that contains the value of $F{f1} -previous. Have the RESET TYPE set to Group -> Group that has group expression of $F{f1} Change the evaluation time of the textfield that contains the variable, and then use the print when expression on the textfield. Variable Name: previousValueClass: (Same as $F{f1})Reset Type: Group -> (Group Expression is $F{f1})Calc Type: NoneInitial expression: $F{f1}Variable expression: $F{f1} This or something similar to it should work...Hope it helps... Link to comment Share on other sites More sharing options...
richard_07 Posted August 1, 2007 Author Share Posted August 1, 2007 Thank you for your answers, I understand what I have to do, but you said to me: "Have the RESET TYPE set to Group -> Group that has group expression of $F{f1}" The problem is that I dont have any group in the report, I evaluate all the fields in the detail band. Is the same? Link to comment Share on other sites More sharing options...
codyjasperForge Posted August 1, 2007 Share Posted August 1, 2007 So create a group.Just set the height of the Group Header & Group Footer to 0. You need the group so that you can reset the variable.The group expression should be the field that you want to evaluate the previous value on. So, when that value changes, (from previous to a new value) the group resets the variable... Does this make sense? Link to comment Share on other sites More sharing options...
richard_07 Posted August 1, 2007 Author Share Posted August 1, 2007 It works! more or less, I will continue provingbecause dont print any field but now I know how work it. Thank you so much. Link to comment Share on other sites More sharing options...
redwine Posted August 1, 2007 Share Posted August 1, 2007 richard_07 Try doing this: 1) Right click on the text field (the one which you don't want repeating values).2) Select properties & select the Common tab.3) Uncheck the Print Repeated Values attribute. This will suppress the printing of repeating values on your generated report. edwin 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