Jump to content

column header sorting


elimesika

Recommended Posts

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

It is possible but it depends of your implementation of JasperReports. Most of the time, we pass a parameter that indicates the sorting order of your column at the generation of your report.

The problem is that, every time you want to reorder a column, you have to re-generate the report.

Link to comment
Share on other sites

Any Ideas how to do sorting by clicking on the column header?

I tried to pass the column number as a parameter and then do an 'order by' in the SQL Query but it didn't work.
The order by does nothing. I'm using Jasperserver 3 and Oracle 10g.

Thanks,
Rafael.

Link to comment
Share on other sites

Rafael,

 

You should be able to do the sorting like you're describing. You'll have a parameter that gets set to "ORDER BY MyColumn". And the SQL query will look like this:

SELECT
...
WHERE ...
$P!{MyOrderByParam}
 

 

Another option that people may want to consider is the "HTML Template Exporter". It supports column sorting, hide/showing sections (folding), and pop-up windows. It is a utility available in the JasperShop.

 

Regards,
Matt

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...