balacs11 Posted March 20, 2019 Share Posted March 20, 2019 I am facing an issue with sorting the data when special character is there in the text valueMy data looks like the below ,Column name : Data1.Value Sort 12.ValueSort13.Value!Sort14.Value#Sort15.Value_Sort1I have sorting field "Data" set to AscendingIt sorts like the below,1.Value_Sort12.Value!Sort13.Value#Sort14.ValueSort15.Value Sort 1The encoding is UTF-8. Expected output:1.Value Sort 12.Value!Sort13.Value#Sort14.Value_Sort15.ValueSort1Any idea why it is happening like this? Link to comment Share on other sites More sharing options...
hozawa Posted March 21, 2019 Share Posted March 21, 2019 You haven't provided steps to reproduce so I'm not certain but it may be that the jdbc driver needs encoding argument. Link to comment Share on other sites More sharing options...
Friendly User Posted March 21, 2019 Share Posted March 21, 2019 Sort Field uses default Java comparator to sort the fields. I don't think it's possible to implement a custom comparator for the Sort Field feature. This sounds like an enhancement reuqest territory Link to comment Share on other sites More sharing options...
hozawa Posted March 23, 2019 Share Posted March 23, 2019 If you're using a database, it's better to use 'ORDER BY' clause in the sql statement instead of using JasperReports' sort feature because sort feature uses in-memory sorting.Following interface explains about JasperReports sort feature.http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRSortField.html Link to comment Share on other sites More sharing options...
balacs11 Posted April 1, 2019 Author Share Posted April 1, 2019 Thanks for the valueable inputs. I have tried these and finally ended up accepting the default behavior of Jaspersoft sorting.1)Changing the encoding in server level - but didnt work2)Moving the sort order to query - it works but my report requirement (Crystal report vs Jasper comparison )In addition , It is a comparison between Crystal and Jasper reports. These two never gets same sort order even if the sorting is moved to query. 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