Jump to content
We've recently updated our Privacy Statement, available here ×

Hide detail band when table fetching empty record


t_pin0245

Recommended Posts

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?

 

Thanks

TP

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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

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.
 

Capture(42).PNG.bafc8639f2a4f567d92ba0d2f7c0a7db.PNG

what to do if i want to hide the band if the table(orange highlighted box) fetching empty record?

Thanks
TP

 

 

Link to comment
Share on other sites

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 checkfield

so, 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...