private void tsslexcel_Click(object sender, EventArgs e)
 {
     try
     {
         if (i < 0)
         {
             return;
         }
         disable();
         saveFileDialog1.Filter = "Excel |*.xls"; saveFileDialog1.FileName = "";
         if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string maloaihang = dtgvhienthi["MaHangHoa", i].Value.ToString();
             Report.rptBaoCaoNhapHangTheoMatHang report = new Report.rptBaoCaoNhapHangTheoMatHang();
             report.SetDataSource(ChiTietHang(maloaihang));
             report.SetParameterValue("Ky", thang.ToString() + "-" + nam.ToString());
             report.SetParameterValue("TenBaoCao", "Báo Cáo Nhập Hàng Theo Hàng Hóa");
             frmBaoCaorpt a = new frmBaoCaorpt(report, saveFileDialog1.FileName, Report.ExportCrystalReport.TypeBC.Excel);
             a.Dispose();
         }
     }
     catch
     {
     }
     finally
     {
         enable();
     }
 }
 private void tsslchitiet_Click(object sender, EventArgs e)
 {
     if (i < 0)
     {
         return;
     }
     try
     {
         disable();
         string maloaihang = dtgvhienthi["MaHangHoa", i].Value.ToString();
         Report.rptBaoCaoNhapHangTheoMatHang report = new Report.rptBaoCaoNhapHangTheoMatHang();
         report.SetDataSource(ChiTietHang(maloaihang));
         report.SetParameterValue("Ky", thang.ToString() + "-" + nam.ToString());
         report.SetParameterValue("TenBaoCao", "Báo Cáo Nhập Hàng Theo Hàng Hóa");
         frmBaoCaorpt a = new frmBaoCaorpt(report);
         a.ShowDialog();
     }
     catch
     {
     }
     finally
     {
         enable();
     }
 }
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptBaoCaoNhapHangTheoMatHang rpt = new rptBaoCaoNhapHangTheoMatHang();

            rpt.Site = this.Site;
            return(rpt);
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     rptBaoCaoNhapHangTheoMatHang rpt = new rptBaoCaoNhapHangTheoMatHang();
     rpt.Site = this.Site;
     return rpt;
 }
 private void tsslWord_Click(object sender, EventArgs e)
 {
     try
     {
         if (i < 0)
             return;
         disable();
         saveFileDialog1.Filter = "Word |*.doc"; saveFileDialog1.FileName = "";
         if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             string maloaihang = dtgvhienthi["MaHangHoa", i].Value.ToString();
             Report.rptBaoCaoNhapHangTheoMatHang report = new Report.rptBaoCaoNhapHangTheoMatHang();
             report.SetDataSource(ChiTietHang(maloaihang));
             report.SetParameterValue("Ky", thang.ToString() + "-" + nam.ToString());
             report.SetParameterValue("TenBaoCao", "Báo Cáo Nhập Hàng Theo Hàng Hóa");
             frmBaoCaorpt a = new frmBaoCaorpt(report, saveFileDialog1.FileName, Report.ExportCrystalReport.TypeBC.WordForWindows);
             a.Dispose();
         }
     }
     catch
     {
     }
     finally
     {
         enable();
     }
 }
 private void tsslchitiet_Click(object sender, EventArgs e)
 {
     if (i < 0)
         return;
     try
     {
         disable();
         string maloaihang = dtgvhienthi["MaHangHoa", i].Value.ToString();
         Report.rptBaoCaoNhapHangTheoMatHang report = new Report.rptBaoCaoNhapHangTheoMatHang();
         report.SetDataSource(ChiTietHang(maloaihang));
         report.SetParameterValue("Ky", thang.ToString() + "-" + nam.ToString());
         report.SetParameterValue("TenBaoCao", "Báo Cáo Nhập Hàng Theo Hàng Hóa");
         frmBaoCaorpt a = new frmBaoCaorpt(report);
         a.ShowDialog();
     }
     catch
     {
     }
     finally
     {
         enable();
     }
 }