Jump to content

sort report by variable


donbowden

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 2 weeks later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...