Link to home
Start Free TrialLog in
Avatar of finance_teacher
finance_teacher

asked on

C# --> Microsoft Report Viewer -- "SORT" order ?

How can I get the below Microsoft Report Viewer to display the same "SORT" order as the user selected ?

1.      user runs Form1.cs

2.      below code runs
              **this.gML_ROITEMTableAdapter.FillBy_History(this.dataSet1.GML_ROITEM,...)

3.      user clicks on a CELL header (Description, StockNum,  Date, or something else)
              **example = user clicks "QtyRcvd" to sort in descending order (attached 1.jpg)

4.      user clicks PRINT

5.      attached unordered results display, without "QtyRcvd" sorted in descending order (attached 2.jpg)
              ** two .cs files attached
0001.jpg
0002.jpg
form.txt
print.txt
ASKER CERTIFIED SOLUTION
Avatar of Siyamala
Siyamala
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of finance_teacher
finance_teacher

ASKER

Ok, how can I get the below "this.reportViewer1.Sort("ROM_ID");"
to work since this.reportViewer1.Sort() = "ROM_ID"; also failed ?
------------------------------------------------------------------------
 public RO_MatReq_History_Print(DateTime vStartDate, DateTime vEndDate, string vSTOCKNUM, string vROMID)
        {
            InitializeComponent();
            this.GML_ROITEMTableAdapter.FillBy_History(this.DataSet1.GML_ROITEM, vStartDate, vEndDate, Properties.Settings.Default.SettingsUserID, vSTOCKNUM, vROMID);
            //this.GML_ROITEMBindingSource.Sort = "ROM_ID";
            this.reportViewer1.RefreshReport();
            this.reportViewer1.Sort("ROM_ID");
        }