Crystal report passing parameter to a dataset from a dataAdapter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gggram2000
    New Member
    • Nov 2007
    • 97

    Crystal report passing parameter to a dataset from a dataAdapter

    Hey, I've tried creating a dataset so that the report displays a certain data that i query. My code looks like this:


    Code:
    // getting the dataset
                    string connString = System.Configuration.ConfigurationSettings.AppSett  ings.Get("ConnectionString");
                    string query = "Select * from SaleReceipts";                           
                    conn = new OleDbConnection(connString);
                    conn.Open();
                    da = new OleDbDataAdapter(query, conn);                                
                    ds = new DataSet();
                    da.Fill(ds,"SaleReceipts");    
                                    
                    // Crystal report code
                    Report1 rpt1 = new Report1();                
                    rpt1.SetDataSource(ds);                 
                    crystalReportViewer1.ReportSource = rpt1;
    My problem is that when the report displays it only displays the first row instead of all (*). Is there anything wrong with this code?
  • ranjana1980
    New Member
    • Jul 2008
    • 15

    #2
    string connString = System.Configur ation.Configura tionSettings.Ap pSett ings.Get("Conne ctionString");
    string query = "Select * from SaleReceipts";
    conn = new OleDbConnection (connString);
    conn.Open();
    da = new OleDbDataAdapte r(query, conn);
    dataset ds = new dataset();
    // ds = new DataSet();
    da.Fill(ds,"Sal eReceipts");

    // Crystal report code
    Report1 rpt1 = new Report1();
    rpt1.SetDataSou rce(ds);
    crystalReportVi ewer1.ReportSou rce = rpt1;

    Comment

    Working...