Difference between revisions of "LabLynx KB:Adding order by in AR6"

From LIMSWiki
Jump to navigationJump to search
(Added article.)
(No difference)

Revision as of 17:31, 24 October 2011

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;

}