コード例 #1
0
ファイル: CRPKhachHang.cs プロジェクト: tuongvyk4/KTPM
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CRPKhachHang rpt = new CRPKhachHang();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
ファイル: TKDS_KH.cs プロジェクト: tuongvyk4/KTPM
        private void TKDS_KH_Load(object sender, EventArgs e)
        {
            CryReport.CRPKhachHang cr           = new CryReport.CRPKhachHang();
            SqlConnection          myConnection = new SqlConnection(@"Server = BADUY\SQLEXPRESS;database=banhang; user id = sa;password = 123456");
            //String sql = "Select * from KhachHang where MaKH = 'ASC'";
            String sql = "Select * from KhachHang";

            DataSet        Dataset1      = new DataSet();
            SqlDataAdapter myDataAdapter = new SqlDataAdapter(sql, myConnection);

            myDataAdapter.Fill(Dataset1, "KhachHang");
            cr.SetDataSource(Dataset1.Tables["KhachHang"]);

            crystalReportViewer1.ReportSource = cr;
            crystalReportViewer1.Refresh();
            crystalReportViewer1.Show();
        }