donbowden Posted April 16, 2009 Share Posted April 16, 2009 Hi Everyone, I have created a variable called "SalesStatus" within iReport I would like to be the top level sort. Can I do that within iReport? Thanks. Don Link to comment Share on other sites More sharing options...
dprogrammer Posted April 16, 2009 Share Posted April 16, 2009 You can create a parameter and use it in Order by clause of your query to sort on it . The parameter doesn't need to accept input, you can hard code field name etc that you want to sort with. Link to comment Share on other sites More sharing options...
Vector Posted April 30, 2009 Share Posted April 30, 2009 I doesnt't work.I have iReport 3.1.4.I have a parameter 'orderfield' (type java.lang.String) = "f_point1name"...And in report query I ahve ORDER BY clause: ORDER BY $P{orderfield}.My dataset does not ORDER!!! I think it is because of parameter type String.It is inserted as string parameter (like in WHERE clause), not as a string... Code:SELECT hbp1."f_name" AS "f_point1name", hbp2."f_name" AS "f_point2name", hbl."f_value" FROM "hb_lengths" hbl LEFT OUTER JOIN "hb_points" hbp1 ON hbl."f_point1"=hbp1."f_uid" LEFT OUTER JOIN "hb_points" hbp2 ON hbl."f_point2"=hbp2."f_uid" WHERE hbl."f_division"=$P{division} ORDER BY $P{orderfield} Link to comment Share on other sites More sharing options...
clarson Posted April 30, 2009 Share Posted April 30, 2009 Aliasvector, Try changing your parameter from $P{orderfield} to $P!{orderfield} -Cam Link to comment Share on other sites More sharing options...
Vector Posted May 4, 2009 Share Posted May 4, 2009 O! Super! Thank you clarson! It works fine! So cool! 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