Jasper Report Table Component

The Table component in JasperReports is a powerful tool to display tabular data. It is more flexible than simply placing fields in the detail band, especially for sub-datasets.

Creating a Table

To add a table to your report:

  1. Drag the Table element from the Palette into your report band (usually Summary or Detail).
  2. The Table Wizard will open.

Table Wizard Steps

  • Dataset: Create a new dataset or use an existing one. For tables, you usually need a separate dataset if the data source is different from the main report.
  • Connection: Select the data connection for the dataset.
  • Columns: Select fields to display as columns.
  • Layout: Choose headers, footers, and grouping options.

Styling

You can style individual cells, rows, or columns. Jaspersoft Studio provides table styles (alternating row colors, header styles) that can be applied automatically.