victorg Posted March 22, 2012 Share Posted March 22, 2012 HiI was trying to write, without luck, a particular String alphabetic sorting algorithm in Java.Not everybody interprets alphanumeric sorting same way, specially when dealing with non-english characters.I found that iReport, in a particular scenario, does sorting exactly the way I was looking for and I would be very grateful to know how did you achieve this.the scenario is, from iReport Report Query dialog: XPath query source XML field type: java.lang.String sort by field, ascendingwho exactly is performing this sorting? the xpath engine? is implemented in JasperReports engine code in java?can I do it in Java?thanksVictorPost Edited by victorg at 03/22/2012 15:38 Link to comment Share on other sites More sharing options...
victorg Posted March 22, 2012 Author Share Posted March 22, 2012 found!java.text.Collator is my friendexample for alphabetic sorting according to a specific language: Collator collator = Collator.getInstance(new Locale("US-en"));Collections.sort(myStringList, collator); thanks anyway Victor Post Edited by victorg at 03/22/2012 16:18 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