Crystal Reports无法导入给定的数据源

时间:2014-04-01 05:05:41

标签: crystal-reports

DataTable dt = new DataTable();
private void crystalReportViewer1_Load(object sender, EventArgs e)
 {
   dt.Rows.Clear();

   string str = ConfigurationManager.ConnectionStrings["ConnData"].ConnectionString.ToString();

  SqlConnection con = new SqlConnection(str);
  OrderDelivery Od = new OrderDelivery();
  Od.Activate();
  DataSet ds = Od.GetDeliveryReportDetails();//Here Am Getting DataSource But this Data 

来源无法绑定到我的Crystal报告:

        int j = ds.Tables[0].Rows.Count;


        ReportDocument rd = new ReportDocument();
        ConnectionInfo info = new ConnectionInfo();
        info.DatabaseName = "DbName"
        info.UserID = "UserName";
        info.Password = "Password";

        rd.SetDataSource(ds);
        rd.VerifyDatabase();

        rd.Load(@"C:\Users\Abhinavu\Documents\Login\Login\Rpr1.rpt");


        crystalReportViewer1.ReportSource = rd;
        crystalReportViewer1.RefreshReport();
        rd.Refresh();   

0 个答案:

没有答案