Search code examples
jasper-reportsjasperserverjaspersoft-studio

Disable column sorting or filtering on report or column


New to Jaspersoft reports...

According to this Jaspersoft Community page How to disable Table sorting/filtering feature (JIVE), Table sorting and filtering can be disabled per report or column.

If so, what are the steps to implement it?

What do I add the property to in the outline? I have tried the Table, the Column Header label, the Detail Text field, etc.

  • I right click and choose Show Properties.
  • Click Edit Properties from the Properties window.
  • Add a new Component Property of "net.sf.jasperreports.components.table.column.sortable". or filterable
  • Set the value to false.
  • Publish the report to Jaspersoft server.
  • Refresh the report in Jaspersoft server.
  • Filtering and sorting are still enabled.
  • Publish the report
  • Refresh the Jaspersoft server page
  • Filtering and sorting are still enabled

Solution

  • The properties needs to be set on the table column node/object itself, and on an element in a column cell/section. This makes sense from the JasperReports library point of view, but doing it in Jaspersoft Studio is a little awkward.

    What you need to do is to open the table in the Outline view, then expand any table section (such as Detail), select the column node under the section (not the element in the column), right click, Show Properties and then in the Properties view go to Advanced and Misc/Edit Properties (which shows a button when you click [Properties]).

    This is how it looks like on my machine:

    screenshot

    After setting, for instance, the net.sf.jasperreports.components.table.column.sortable property to false for a column:

    enter image description here

    running the report in JasperReports Server will have sorting disabled for the column:

    enter image description here