Hi, We have added a new tag to JRXML called <sortField>. It has two attributes: name and order. Several such tags could appear right after the normal report field list. If present, the engine will use a new JRSortableDataSource to wrap the initial report data source, iterate through all its records and perform an in-memory sorting before passing the sorted data source to the report filling engine. This can already be seen in the SVN repository at JasperForge.org where we currently host the JasperReports source code. Note that this list of sorting fields is static (part of the report template). This is because sorting is usually very tied to grouping and since you cannot dynamically change grouping you should not dynamically change sorting either. You can see this working in the /demo/samples/csvdatasource sample where the records are not sorted in the CSV file, but appear sorted in the generated report.
P.S. Please register to the new JasperForge forums, because we are going to close this mailing list on Friday, October the 6th. http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215 Thank you, Teodor Rahul Sood wrote: > Here is the scenario - > For my company I implemented JasperReports as the reporting software > since we wanted to move away from fee based software. so far so good. > We use a custom datasource to fill up our report. In other words > Jasper does not connect to db at all. For a report that I am currently > working on my db team has written a stored procedure. One of the > things that a client can do is choose the sort by col. They would do > this by checking a radio button. They have a choice of three cols. eg. > radio buttons have col1, col2 and col3 as choice. The user could > choose col3 as the sort button. As a result the report should first be > sorted by col3 and then by col2 and col1 in any order. Always the > first col will be the user's choice. My db team says that they cannot > parametrize the order by clause in the sql. They have asked me to see > if I can pass in the user's choice to Jasper and Jasper can take care > of changing the sort order. In the past I have implemented a cross > tabs report using Jasper and I know that cross tabs can sort. But as > far as I know I am not sure if I can change the sorting order runtime. > Would anyone know if this can be done in Jasper and if so than how. > thanks > rahul > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > jasperreports-questions mailing list > jasperreports-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jasperreports-questions > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ jasperreports-questions mailing list jasperreports-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jasperreports-questions