Skip to main content



      Home
Home » Archived » BIRT » Parameterize the Order By Clause?
Parameterize the Order By Clause? [message #1403441] Wed, 23 July 2014 12:31 Go to next message
Eclipse UserFriend
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 16:26 Go to previous message
Eclipse UserFriend
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"];
Previous Topic:Aggregation BIRT
Next Topic:Using table inside Crosstab cell
Goto Forum:
  


Current Time: Wed Jul 16 06:02:58 EDT 2025

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

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

Back to the top