t_pin0245 Posted January 7, 2016 Share Posted January 7, 2016 Good day,in my main report, there are numerous detail bands with table respectively. currently, the empty record band leaving a blank space in between, which doesn't look good at all.How can i hide or not showing the band whenever the table fetching empty record? ThanksTP Link to comment Share on other sites More sharing options...
k manohar Posted January 7, 2016 Share Posted January 7, 2016 Hi, Thank u for raising Query. When ever create number of detail bands, in each details band you have mention any field or parameter or variable. After that click on band which band you want to hide and once see properties in that you have "print when condition " is there, in that condition write small line !($F{id}.isEmpty()).... Thats enough...you can get sucess...... Link to comment Share on other sites More sharing options...
t_pin0245 Posted January 7, 2016 Author Share Posted January 7, 2016 Hi manohar,but in my case, i wish to write the condition based on table in the detail band. for clearer view, please refer to the image below. what to do if i want to hide the band if the table(orange highlighted box) fetching empty record?ThanksTP Link to comment Share on other sites More sharing options...
zh3ntil Posted January 7, 2016 Share Posted January 7, 2016 That's a little bit tricky I guess :) maybe you can try do sth like this. add a column your main report query and the query will be your table dataset query with COUNT().(select count(*) from ... where ... ) as checkfieldso, if checkfield is 0 then it means there is no record for that specific row.After that you can use this field for print when expressin of detail band :) Link to comment Share on other sites More sharing options...
t_pin0245 Posted January 8, 2016 Author Share Posted January 8, 2016 Hi zh3ntil,your suggestion is working fine for me! thank you!but there's another special case comes in, in my table, there are some record but with spacing as value.hence, if i use the (select count(*) ... where ...) as checkfield, which seems not applicable anymore since there's record selected.so how can i control it in this case? your help is much appreciated. Link to comment Share on other sites More sharing options...
zh3ntil Posted January 8, 2016 Share Posted January 8, 2016 ıf you send your selectable fields in to your subquery you will get this.For example,select id,name,(select count(*) from tasks where per_id=x.id) as checkfieldfrom person xwhere $X{IN"x.id","personid"} 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