Change sort order in Crystal Report

Last post 07-02-2009 4:51 AM by gbetsos. 0 replies.

Sort Posts:

  • Change sort order in Crystal Report

    07-02-2009, 4:51 AM
    • Participant
      758 point Participant
    • gbetsos
    • Member since 05-07-2007, 11:26 AM
    • Greece
    • Posts 163

    Hello,

    I have the following very simple piece of code:

    ReportDocument ReportDoc = new ReportDocument();
    string sReportFile = this.Server.MapPath("~/Reports/catalogue.rpt");
    ReportDoc.Load(sReportFile);
    ReportDoc.SetDataSource((DataTable) dtCatalogue);
    rpvCatalogue.ReportSource = ReportDoc;
    


    rpvCatalogue is just a CrystalReportViewer used to display the report on a web page. What I want
    is to programmatically change the sort order of the report's DataTable (dtCatalogue).

    I have tried this:

       dtCatalogue.DefaultView.Sort = "title desc";

    but it does not work. Titles still appear on my report in ascending, not descending order.

    Any help will be greatly appreciated!

    Much ado about nothing
Page 1 of 1 (1 items)