Message de Johnny Rosenberg  date 2009-05-24 18:44 :
2009/5/24 Oliver Brinzing <[email protected]>:
Hi Johnny,

With Xray I found not only createSearchDescriptor in a range, but also
createSortDescriptor. However, I can't find any information anywhere
about how to use it. The Search thing is easy and II use it all the
time, like this:
http://wiki.services.openoffice.org/wiki/Documentation/OOo3_User_Guides/Calc_Guide/Sorting

Yes, that was one of the examples that I was talking about. So my
question remains: How can I sort using the method I described in my
original post, rather than the method described at various places at
the Internet?

(...)
The link you provided is certainly enough for me to being able to
sort, BUT it doesn't use the Range.createSortDescriptor at all, as far
as I can see. My question isn't about how I can sort, because there
are a lot of examples on how to do that, yours are one of them. My
question is how to use the ”createSortDescriptor” of a range like that
one described above.

If it's impossible, I wonder why they included ”createSortDescriptor”
for ranges in the first place. If it's there, it should be possible to
use, right?


Yes, it is possible to use it, but it's not easy at all ! Because createSortDescriptor returns an array of PropertyValue, not an object as for createSearchDescriptor (you can see it with Xray). Then you must find out at which position is each PropertyValue (eg property "SortFields") that you have to fill in. It's not possible without a helper routine which scans the array. It is much simpler to create your own array of PropertyValue and fill each, like in the Developer's Guide example (in Java)
<http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Sorting>

Also, sorting is not simple because the argument of sort() routine is an array of PropertyValue, of which "SortFields" contains another array of PropertyValue.

Regards
  Bernard


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to