peter_tonev Posted August 5, 2013 Share Posted August 5, 2013 Hello community, I need to sort the content in my report based on clicking the data header (i.e. some sort of hyperlink). I found out that Jasper has the sort component, but it is rendered as a seperate element (an up / down arrow) which you can place anywhere. Is there a way to define a hyperlink on data field headers (or column headers) and then when clicking on it to sort ascending (by second click - descending) the data based on the underlying data field, instead of going to some reference mark or executing another report?I found a workaround on this - first click executes an ascending sorted report in the same page frame, second click executes a descending sorted report. But this is a clumsy soution for I have more columns and hence I have to create two reports for each column which is a no go. Furthermore, this way the data set is recreated each time and what I only need is just sort the already fetched data. Thanks and regards,Peter Link to comment Share on other sites More sharing options...
Solution peter_tonev Posted August 6, 2013 Author Solution Share Posted August 6, 2013 OK, I figured it out myself, here a solution for the interested:Pull a sort component from the pallete, define the column (set) by which it should sort, set "opaque" property off, set evaluation to "Now", align the sort component to the right, make it a little bit wider as your header, put it over the header so that the right aligned arrow does not overlap with the text, done.Now when you deploy the report on the JRS and run it, you will get a hyperlink over your text (column header); click it once - report content gets sorted ascending by the ccolumn (set) defined and an up-arrow is rendered, second click - it gets sorted descending and a down-arrow is represeted, third click - sort is removed (the data set reappears in the initial sort order) and no arrow is showing. Cheers, Peter Link to comment Share on other sites More sharing options...
bhomass Posted November 29, 2015 Share Posted November 29, 2015 sorry, this is two years later. I am not sure if your anwer is applicable to the jaspersoft studio. I don't see any sort component in the pallete. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now