Chào mừng đến với Diễn đàn lập trình - Cộng đồng lập trình.
Kết quả 1 đến 2 của 2
  1. #1
    Ngày tham gia
    Sep 2015
    Bài viết
    0

    Làm báo cáo với Crystal Report không thành công!

    Dear all!

    Mình làm Crystal Report với đoạn mã sau trên nut button nhưng ko xuất ra được báo cáo. Mọi người giúp mình với, Thanks all!

    //Tao Connection
    String ConnectionString = "Data Source=****;Initial Catalog=****;Persist Security Info=True;User ID=****;Password=****";
    SqlConnection Connection = new SqlConnection(ConnectionString);
    ReportDocument reportDocument = new ReportDocument();
    Connection.Open();

    String CommandText = "select * from ThietBiIT";
    SqlCommand Command = new SqlCommand(CommandText, Connection);
    //Command.CommandType = CommandType.StoredProcedure;
    SqlDataAdapter da = new SqlDataAdapter(Command);

    DataTable ds = new DataTable();
    da.Fill(ds);
    GridView1.DataSource = ds;
    GridView1.DataBind();

    reportDocument.Load(Server.MapPath("CrystalReport. rpt"));
    reportDocument.SetDataSource(ds);
    CrystalReportViewer1.ReportSource = reportDocument;
    CrystalReportViewer1.DataBind();
    Connection.Close();

  2. #2
    Ngày tham gia
    Sep 2015
    Bài viết
    0
    Debug xem nó có lấy dc dữ liệu chưa
    http://expressmagazine.net/development/1541/c-huong-dan-tao-crystal-reports-bang-dataset
    http://www.codeproject.com/Articles/28899/Crystal-Report-with-DataSet-and-DataTable-using-C

 

 

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •