37635

How do I hide a table that has no data on ireport?

Question:

How do I hide a table (not include in layout) that has no data?

Answer1:

If you have the table on its own band, what I typically do is set a print when condition on the band that only shows the data if any object in that band has data. Say your table is something like this:

item1 item2 item3

The print when expression would look something like this:

item1 != null || item2 != null || item3 != null

If you're referring to a subreport built using a collection, then I just check to make sure the collection isn't empty:

!subreportCollection.isEmpty()

Putting the print when condition on the band line hides the data, and causes the report to collapse the unused space.

Recommend

  • Pivot rows into columns
  • Get option from specific start position?
  • Entity framework, referential integrity constraint violation occurred error on updating entity from
  • Specific pathing to find XML elements using minidom in Python
  • Remove property by value from object
  • How to invoke ActionListener for MenuItem in primefaces
  • Changing the color of an image link on hover
  • Get sibling of Vaadin Tree Item?
  • inserting items in list in mongodb document
  • NUnit 3.0 TestCase const custom object arguments
  • Plotting line graph with factors in R
  • std::remove_copy_if_ valgrind bytes in block are possibly lost in loss record
  • presentShareDialogWithParams posts to FB wall, but callback handler results say error
  • Eloquent paginate function in Slim 3 project using twig
  • How to determine if there are bytes available to be read from boost:asio:serial_port
  • How do I exclude a dependency in provided scope when running in Maven test scope?
  • How to write order and limit within cakephp joins array
  • Can you perform a UNION without a subquery in SQLAlchemy?
  • $wpdb not working in file of WordPress plugin
  • Meteor helpers not available in Angular template
  • FFmpeg Conversion Error
  • Controls, properties, events and timers running in design time
  • MySQL WHERE-condition in procedure ignored
  • Updated Ionic CLI but shows previous version (Windows)
  • Why is the timeout on a windows udp receive socket always 500ms longer than set by SO_RCVTIMEO?
  • AT Commands to Send SMS not working in Windows 8.1
  • Linker errors when using intrinsic function via function pointer
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • Buffer size for converting unsigned long to string
  • Rails 2: use form_for to build a form covering multiple objects of the same class
  • Hits per day in Google Big Query
  • How do I configure my settings file to work with unit tests?
  • Setting background image for body element in xhtml (for different monitors and resolutions)
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How to get Windows thread pool to call class member function?
  • LevelDB C iterator
  • Is it possible to post an object from jquery to bottle.py?
  • Reading document lines to the user (python)
  • How can i traverse a binary tree from right to left in java?
  • Python/Django TangoWithDjango Models and Databases