tags:

views:

328

answers:

1

I am using WebViewerExample as my reporting.

I am designing reports within Eclipse using report designer.

I have a table with several columns. Data is retrieved from database.

Is there an easy way to dynamically sort the tables by clicking on the column header names?

I tried to pass string as a sorting condition, but it ain't helping.

Any ideas?

+1  A: 

Have you tried adding an ORDER BY to the query and ten parameterizing it? You may need to do some REALLY lightweight scripting in order to massage the underlying query at run-time. All that we are talking about is doing a string replace on the sort condition in the query.

Original Query:

SELECT Col1, Col2, Col3, Col4
FROM Table1
WHERE Something = Something
ORDER Col1 ASC

The beforeOpen Event on the Data Set:

this.queryText = this.queryText.replace("Col1", "Your new Sort Spec");

That will do the trick. Good Luck!

MystikSpiral