LabLynx KB:adding order by in AR6

From LIMSWiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Problem

There has been a problem with adding the "Order By" field to the report engine.

Resolution

The "datasource" being set by the AR6 ReportEngine is a DataSet. So, to add "Order By", you need to create/manipulate the default view as shown below and then reset the report DataSource with that new modified view. Code is as follows:


public void ActiveReport_ReportStart()

{

                System.Data.DataSet ds = (System.Data.DataSet) rpt.DataSource;

                System.Data.DataView dv = ds.Tables[0].DefaultView;

                dv.Sort = "basetestid,paramorder,reportorder";

                rpt.DataSource = dv;

}