realnull Posted August 31, 2007 Share Posted August 31, 2007 How to sort fields using iReport ? i know there is a tag <sortfields/> which i manually add in jrxml files , but i'm wondering can i do it directly from iReport ? Link to comment Share on other sites More sharing options...
jmurray Posted August 31, 2007 Share Posted August 31, 2007 There's a "Sort Options..." button at the bottom of the Report Query dialog box. It injects the Sortfield elements into your xml for you. Be careful though: any sorting specified within the source query will override Sortfield specifications. Link to comment Share on other sites More sharing options...
Case1182 Posted September 1, 2007 Share Posted September 1, 2007 at the end of your SQL add this Code:ORDER BYYOURTABLE.YOURCOLUMN ASC ASC for Ascending DESC for Descending, if using multiple sorts it is like this. Code:[code]ORDER BYYOURTABLEFIRSTSORT.YOURCOLUMNFIRSTSORT ASC, YOURTABLESECONDSORT.YOURCOLUMNSECONDSORT DESC, YOURTABLETHIRDSORT.YOURCOLUMNTHIRDSORT ASC you can keep going as long as you like, just seperate with commas and no comma on last entry :) 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