Jump to content
We've recently updated our Privacy Statement, available here ×

I need the String alphabetic sorting iReport does!


victorg

Recommended Posts

 Hi

I 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, ascending

who exactly is performing this sorting? the xpath engine? is implemented in JasperReports engine code in java?

can I do it in Java?

thanks

Victor



Post Edited by victorg at 03/22/2012 15:38
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

 found!

java.text.Collator is my friend

example 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

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