Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CRPNhanVien rpt = new CRPNhanVien();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        private void TKDS_NV_Load(object sender, EventArgs e)
        {
            CryReport.CRPNhanVien cr           = new CryReport.CRPNhanVien();
            SqlConnection         myConnection = new SqlConnection(@"Server = BADUY\SQLEXPRESS;database=banhang; user id = sa;password = 123456");
            String sql = "Select * from NhanVien where MaNV = 1";
            //String sql = "Select * from NhanVien";

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

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

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