private void btnViewSoCai_Click(object sender, EventArgs e) { DataTable nkcTable = this.eMSDBDataSet.tbl_NhatKyChung.Where(n => n.NgayGhiSo.Year == int.Parse(cboYearSoCai.Text) && n.SoTKDU == cboTKSoCai.Text).Select(n => n).CopyToDataTable(); soCaiReport = new SoCai(); soCaiReport.SetDataSource(nkcTable); crvReport.ReportSource = soCaiReport; }
private void btnPrint_Click(object sender, EventArgs e) { SoCai soCaiReport = new SoCai(); soCaiReport.SetDataSource(eMSDBDataSet); soCaiReport.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA4; soCaiReport.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait; soCaiReport.PrintToPrinter(1, false, 1, 1); soCaiReport.Dispose(); }