private void btnPrint_Click(object sender, EventArgs e) { try { string s =""; if (dtpFromDate.Value.Date == dtpToDate.Value.Date) { s = string.Format("{0}Ngày {1}", s, dtpFromDate.Value.ToString("dd/MM/yyyy")); } else { s = string.Format("{0}{1}", s, string.Format("Thời gian từ ngày {0} đến ngày {1}", dtpFromDate.Value.ToString("dd/MM/yyyy"), dtpToDate.Value.ToString("dd/MM/yyyy"))); } var crpt = new Crp_DSBN_TestType(); var oForm = new frmPrintPreview("In Báo cáo lưu", crpt, true, true); crpt.SetDataSource(dt); crpt.DataDefinition.FormulaFields["Formula_1"].Text = ""; crpt.SetParameterValue("TongBenhNhan", dt.Rows.Count); crpt.SetParameterValue("TestType_Name",cboTestType.Text.ToUpper()); crpt.SetParameterValue("strFromDateToDate", s); crpt.SetParameterValue("ParentBranchName", ManagementUnit.gv_sParentBranchName); crpt.SetParameterValue("BranchName", ManagementUnit.gv_sBranchName); crpt.SetParameterValue("sCurrentDate", dtCreatePrint.Value); oForm.crptViewer.ReportSource = crpt; oForm.ShowDialog(); oForm.Dispose(); } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { Crp_DSBN_TestType rpt = new Crp_DSBN_TestType(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { Crp_DSBN_TestType rpt = new Crp_DSBN_TestType(); rpt.Site = this.Site; return rpt; }