Exemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crpt_BAOCAO_SOLUONG_XN_THEOKHOA rpt = new crpt_BAOCAO_SOLUONG_XN_THEOKHOA();

            rpt.Site = this.Site;
            return(rpt);
        }
        void LoadDataPrint()
        {
            try
            {
                dtPrint =
                    SPs.GetDataSlXnTheokhoaBacsi(dtpFromDate.Value, dtpToDate.Value,
                                                 Utility.Int32Dbnull(cboDepartment.SelectedValue, -1),
                                                 Utility.Int32Dbnull(cboDoctor.SelectedValue, -1),
                                                 Utility.Int32Dbnull(cboObjectType.SelectedValue, -1),
                                                 Utility.Int32Dbnull(cboTestTypeList.SelectedValue, -1)).GetDataSet().
                        Tables[0];
                if(dtPrint.Rows.Count <= 0)
                {
                    Utility.ShowMsg("Không có dữ liệu theo điều kiện bạn chọn");
                    return;
                }
                var crpt = new crpt_BAOCAO_SOLUONG_XN_THEOKHOA();
                var objForm = new frmPrintPreview("BÁO CÁO SỐ LƯỢNG XÉT NGHIỆM", crpt, true, true);
                Utility.UpdateLogotoDatatable(ref dtPrint);

                crpt.SetDataSource(dtPrint);
                crpt.DataDefinition.FormulaFields["Formula_1"].Text = Strings.Chr(34) + "        NGƯỜI LẬP                                       THỦ TRƯỞNG ĐƠN VỊ           ".Replace("#$X$#", Strings.Chr(34) + "&Chr(13)&" + Strings.Chr(34)) + Strings.Chr(34);
                crpt.SetParameterValue("ParentBranchName", globalVariables.ParentBranch_Name);
                crpt.SetParameterValue("BranchName", globalVariables.Branch_Name);
                crpt.SetParameterValue("Branch_Address", globalVariables.Branch_Address);
                crpt.SetParameterValue("Branch_Phone", globalVariables.Branch_Phone);
                crpt.SetParameterValue("Khoa", cboDepartment.Text);
                crpt.SetParameterValue("BacSi", cboDoctor.Text);
                crpt.SetParameterValue("NgayIn", dtpDatePrint.Value.Date);
                crpt.SetParameterValue("TileRepost", "BÁO CÁO SỐ LƯỢNG XÉT NGHIỆM");
                crpt.SetParameterValue("DateTime","Từ ngày " + dtpFromDate.Value.ToShortDateString() + " đến ngày " + dtpToDate.Value.ToShortDateString());
                objForm.ShowDialog();

            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin báo cáo");
                throw;
            }
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     crpt_BAOCAO_SOLUONG_XN_THEOKHOA rpt = new crpt_BAOCAO_SOLUONG_XN_THEOKHOA();
     rpt.Site = this.Site;
     return rpt;
 }