public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrystalReport3 rpt = new CrystalReport3(); rpt.Site = this.Site; return(rpt); }
private void btXuat_Click(object sender, EventArgs e) { dt_Sach.DefaultView.RowFilter = "MaDG= '" + cbxDG.SelectedValue.ToString() + "'"; CrystalReport3 rpt = new CrystalReport3(); rpt.SetDataSource(dt_Sach.DefaultView); crvDSDG.ReportSource = rpt; }
private void frmReport_Load(object sender, EventArgs e) { cnn = new SqlConnection("Data Source=DESKTOP-HR37HS0\\SQLEXPRESS;Initial Catalog=QLTHUVIEN;Integrated Security=True"); da = new SqlDataAdapter("select * from DOCGIA", cnn); dt_DG = new DataTable(); da.Fill(dt_DG); da.SelectCommand.CommandText = "SELECT ThongKeDG_1.* FROM dbo.ThongKeDG() AS ThongKeDG_1"; dt_Sach = new DataTable(); da.Fill(dt_Sach); cbxDG.DataSource = dt_DG; cbxDG.DisplayMember = "HoTen"; cbxDG.ValueMember = "MaDG"; cbxDG.SelectedIndex = -1; CrystalReport3 rpt = new CrystalReport3(); rpt.SetDataSource(dt_Sach.DefaultView); crvDSDG.ReportSource = rpt; }