Beispiel #1
0
        public bool ShowPrintView(DataTable table, string reportName)
        {
            this.ReportType = ReportCache.Instance.GetWardReportType(SystemData.ReportTypeApplyEnv.STATISTIC, reportName);
            if (this.ReportType == null)
            {
                MessageBoxEx.ShowMessage("打印报表还没有制作");
                return(false);
            }
            byte[] byteReportData = null;
            ReportCache.Instance.GetReportTemplet(this.ReportType, ref byteReportData);
            if (byteReportData != null)
            {
                ReportExplorerForm reportExplorerForm = new ReportExplorerForm();
                reportExplorerForm.WindowState = FormWindowState.Maximized;

                reportExplorerForm.QueryContext +=
                    new QueryContextEventHandler(this.ReportExplorerForm_QueryContext);
                reportExplorerForm.NotifyNextReport +=
                    new NotifyNextReportEventHandler(this.ReportExplorerForm_NotifyNextReport);
                reportExplorerForm.ReportFileData = byteReportData;
                reportExplorerForm.ReportParamData.Add("是否续打", false);
                reportExplorerForm.ReportParamData.Add("打印数据", table);
                reportExplorerForm.ShowDialog();
            }

            return(true);
        }
Beispiel #2
0
        private void toolmnuPrintAll_Click(object sender, EventArgs e)
        {
            this.Update();
            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);

            if (this.m_byteReportData != null)
            {
                ReportExplorerForm explorerForm = this.GetReportExplorerForm();
                explorerForm.ReportFileData = this.m_byteReportData;
                explorerForm.ReportParamData.Add("是否续打", true);
                explorerForm.ReportParamData.Add("打印数据", 1);
                explorerForm.ShowDialog();
            }
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
Beispiel #3
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.Rows.Count <= 0)
            {
                MessageBoxEx.Show("当前没有可打印内容!");
                return;
            }
            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            string szReportName = string.Empty;

            if (this.toolcboOrdersType.Text == "全部")
            {
                szReportName = "医嘱内容";
            }
            else if (this.toolcboOrdersType.Text == "长期医嘱")
            {
                szReportName = "长期医嘱单";
            }
            else if (this.toolcboOrdersType.Text == "临时医嘱")
            {
                szReportName = "临时医嘱单";
            }
            ReportType reportType = ReportCache.Instance.GetWardReportType(SystemData.ReportTypeApplyEnv.ORDERS, szReportName);

            if (reportType == null)
            {
                MessageBoxEx.ShowMessage("打印报表还没有制作");
                return;
            }
            byte[] byteReportData = null;
            ReportCache.Instance.GetReportTemplet(reportType, ref byteReportData);
            if (byteReportData != null)
            {
                System.Data.DataTable table        = GlobalMethods.Table.GetDataTable(this.dataGridView1, false, 0);
                ReportExplorerForm    explorerForm = this.GetReportExplorerForm();
                explorerForm.ReportFileData = byteReportData;
                explorerForm.ReportParamData.Add("是否续打", false);
                explorerForm.ReportParamData.Add("打印数据", table);
                explorerForm.ShowDialog();
            }
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     if (this.dataGridView1.Rows.Count <= 0)
     {
         MessageBoxEx.Show("当前没有可打印内容!");
         return;
     }
     GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
     byte[] byteReportData = this.GetReportFileData(null);
     if (byteReportData != null)
     {
         System.Data.DataTable table        = GlobalMethods.Table.GetDataTable(this.dataGridView1, false, 0);
         ReportExplorerForm    explorerForm = this.GetReportExplorerForm();
         explorerForm.ReportFileData = byteReportData;
         explorerForm.ReportParamData.Add("是否续打", false);
         explorerForm.ReportParamData.Add("打印数据", table);
         explorerForm.ShowDialog();
     }
     GlobalMethods.UI.SetCursor(this, Cursors.Default);
 }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (this.m_lstTestInfo == null)
            {
                this.m_lstTestInfo = new List <DataTable>();
            }
            else
            {
                this.m_lstTestInfo.Clear();
            }

            if (this.dgvLabMaster.Rows.Count <= 0)
            {
                return;
            }

            for (int index = 0; index < this.dgvLabMaster.Rows.Count; index++)
            {
                DataGridViewRow row         = this.dgvLabMaster.Rows[index];
                LabMaster       labTestInfo = row.Tag as LabMaster;

                if (labTestInfo == null)
                {
                    continue;
                }
                DataGridViewCell cell = row.Cells[this.colNeedPrint.Index];
                if (cell == null)
                {
                    continue;
                }
                object objValue = cell.Value;
                if (objValue == null || !bool.Parse(objValue.ToString()))
                {
                    continue;
                }

                List <LabResult> lstResultInfo = row.Cells[this.colYiChang.Index].Tag as List <LabResult>;
                //short shRet = LabResultAccess.Instance.GetList(labTestInfo.TEST_ID, ref lstResultInfo);
                //if (shRet != SystemData.ReturnValue.OK)
                //    continue;
                if (lstResultInfo == null || lstResultInfo.Count <= 0)
                {
                    continue;
                }

                DataTable dtResult = this.CreateResultData(lstResultInfo);
                dtResult = this.CreateTestData(labTestInfo, dtResult);
                this.m_lstTestInfo.Add(dtResult);
            }
            if (this.m_lstTestInfo.Count <= 0)
            {
                MessageBoxEx.Show("请勾选需要打印记录左边的复选框!");
                return;
            }
            if (SystemParam.Instance.LocalConfigOption.IsLabPrintNewMethod)
            {
                DocumentPrintStyleForm frm         = new DocumentPrintStyleForm();
                TempletType            templetType = TempletTypeCache.Instance.GetWardDocType(SystemData.TempletTypeApplyEnv.LAB_REPROT);
                if (templetType == null)
                {
                    MessageBoxEx.ShowMessage("打印表单未制作");
                    return;
                }
                frm.TempletType = templetType;
                frm.Data        = m_lstTestInfo;
                frm.Text        = templetType.DocTypeName;
                frm.ShowDialog();
                return;
            }

            GlobalMethods.UI.SetCursor(this, Cursors.WaitCursor);
            ReportType reportType = ReportCache.Instance.GetWardReportType(SystemData.ReportTypeApplyEnv.LAB_RESULT, this.Text);

            if (reportType == null)
            {
                MessageBoxEx.ShowMessage("打印报表还没有制作");
                return;
            }
            byte[] byteReportData = null;
            ReportCache.Instance.GetReportTemplet(reportType, ref byteReportData);
            if (byteReportData != null)
            {
                ReportExplorerForm explorerForm = this.GetReportExplorerForm();
                explorerForm.ReportFileData = byteReportData;
                explorerForm.ReportParamData.Add("是否续打", false);
                explorerForm.ReportParamData.Add("打印数据", this.m_lstTestInfo);
                explorerForm.ShowDialog();
            }
            GlobalMethods.UI.SetCursor(this, Cursors.Default);
        }