Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Parameterize the Order By Clause?
Parameterize the Order By Clause? [message #1403441] Wed, 23 July 2014 16:31 Go to next message
andy rush is currently offline andy rushFriend
Messages: 15
Registered: July 2014
Junior Member
So, i'm creating a reporting application using the BIRT API to report against our Postgres database. One goal is to give users the ability to sort the records by any column in the result set. In the BIRT FAQ (http://wiki.eclipse.org/BIRT/FAQ/Data_Access) I find the following:

"Q: When do I use BIRT vs. SQL sorting?

For performance, use SQL sorting whenever possible, especially if your database has indexes that will speed up the sort. If your report has no groups, and your SELECT statement has the correct ORDER BY clause, then simply do not specify a sort order within BIRT."

Based on the above information i create a query in PGAdmin that sorts on a column in the resultset, but when i parameterize the query to sort on a different column, the row order remains the same - the parameter is (apparently) passed into the ReportViewer but has no effect. I don't have a lot of experience with BIRT so, to make sure my procedures were correct, i added a parameter to the WHERE clause which executes perfectly.

So, i'm thinking it is not possible to add a parameter to the ORDER BY clause of an SQL statement in BIRT? Is this correct?

Re: Parameterize the Order By Clause? [message #1407073 is a reply to message #1403441] Mon, 11 August 2014 20:26 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You could add the order by in the beforeOpen script of the dataset. It'd be something like this:

this.queryText = this.queryText + " order by " params["mysortfieldparameter"];


Michael

Developer Evangelist, Silanis
Previous Topic:Aggregation BIRT
Next Topic:Using table inside Crosstab cell
Goto Forum:
  


Current Time: Fri Apr 26 02:28:42 GMT 2024

Powered by FUDForum. Page generated in 0.03049 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top