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

            rpt.Site = this.Site;
            return(rpt);
        }
Exemple #2
0
        private void btntim_Click(object sender, EventArgs e)
        {
            daSach = new SqlDataAdapter("Select * From HoaDonKH where MaHD like '%" + txttim.Text.ToString() + "%'", conn);
            dtSach = new DataTable();
            dtSach.Clear();
            daSach.Fill(dtSach);
            CrystalReport2 rp = new CrystalReport2();

            rp.SetDataSource(dtSach);
            crystalReportViewer1.ReportSource = rp;
        }
Exemple #3
0
 private void btnload_Click(object sender, EventArgs e)
 {
     try
     {
         daSach = new SqlDataAdapter("Select * From HoaDonKH", conn);
         dtSach = new DataTable();
         dtSach.Clear();
         daSach.Fill(dtSach);
         CrystalReport2 rp = new CrystalReport2();
         rp.SetDataSource(dtSach);
         crystalReportViewer1.ReportSource = rp;
     }
     catch (SqlException)
     {
         MessageBox.Show("Không Lấy Được Dữ Liệu");
     }
 }