From: Andre' W. <a.w...@th...> - 2003-01-22 14:52:05
|
Jim Menard wrote: > André, > >> I want to remove all sort statements from a report. >> >> I tried it this way: >> >> SQLColumn sqlColumn = null; >> >> for (java.util.Iterator iter = >> report.getDataSource().getQuery().sortedColumns(); iter.hasNext(); ) { >> sqlColumn = (SQLColumn)iter.next(); >> report.getDataSource().getQuery().removeSort(sqlColumn); >> } >> >> The report has only one sort statement. >> I got an "java.util.ConcurrentModificationException" error. > > > You can't remove items from most kinds of collections while iterating > over them. That's what is causing the concurrent modification exception. > > If you want to remove all the sorts at once, there is already a method > in Query that will do that for you. Call > > report.getDataSource().getQuery().clearSort(); Oh my god! I must be blind. Sorry, i hope you are not neved because of such silly questions. Thanks a lot. Andre -- Thiesen | André Wohnig hardware- & software- design GmbH | a.w...@th... Im Tiegel 9 | www.thiesen.com 36367 Wartenberg | tel. +49 (0) 6641 979-142 fax -299 |