Dynamic sorting of tables in BIRT without javascript

I am using WebViewerExample as my report.

I am developing reports in Eclipse using the report designer.

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

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

I tried to pass a string as a sorting condition but that doesn't help.

Any ideas?

+2


source to share


3 answers


Have you tried adding ORDER BY to the query and parameterizing it ten? You might need to do some REALLY light scripting to mass-scale the main query at runtime. All we are talking about is replacing a collation string in a query.

Original request:

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

      



BeforeOpen event on dataset:

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

      

This will do the trick. Good luck!

+2


source


sorting or filtering on a report may not be a solution

  • birt iserver with interactive web browser do sort
  • I try to do less, but the purest (just open)


so change the viewer to do the job and not the report

http://dev.sonid.fr/BirtViewer/ (hover over the column header)

+1


source


There is an easier way if you have a default.

First set up paramater as sort criteria, in my case I named it "sort". Then select the table, go to the sort tab and use the following expression: string [PARAMS ["view"]. value].

This will sort the table based on the parameter you are passing. You need to make sure the column names are correct.

+1


source







All Articles