Exemplo n.º 1
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            try {
                ReportHelper _ReportHelper = new ReportHelper(gcMain, _ProgramID, this.Text);
                string       datatype      = ddlData.EditValue.AsString();
                if (datatype == "KeyInfo")
                {
                    //重點資料
                    CommonReportPortraitA4 reportPortrait = new CommonReportPortraitA4();//設定為直向列印
                    reportPortrait.printableComponentContainerMain.PrintableComponent = gcMain;
                    reportPortrait.IsHandlePersonVisible = false;
                    reportPortrait.IsManagerVisible      = false;
                    _ReportHelper.Create(reportPortrait);
                }
                else
                {
                    //明細資料,欄位比較多
                    CommonReportLandscapeA3 reportLandscape = new CommonReportLandscapeA3();//設定為橫向列印
                    reportLandscape.printableComponentContainerMain.PrintableComponent = gcMain;
                    reportLandscape.IsHandlePersonVisible = false;
                    reportLandscape.IsManagerVisible      = false;
                    _ReportHelper.Create(reportLandscape);
                }

                _ReportHelper.LeftMemo = labDate.Text + txtSDate.Text; //寫一行標題的註解,通常是查詢條件

                _ReportHelper.Print();                                 //如果有夜盤會特別標註

                return(ResultStatus.Success);
            } catch (Exception ex) {
                WriteLog(ex);
            }
            return(ResultStatus.Fail);
        }
Exemplo n.º 2
0
        protected void AfterSaveForPrint(GridControl gridControl, DataTable dtChange, string systemType, bool IsHandlePersonVisible = true, bool IsManagerVisible = true)
        {
            GridControl gridControlPrint = GridHelper.CloneGrid(gridControl);

            string                  _ReportTitle    = _ProgramID + "─" + _ProgramName + GlobalInfo.REPORT_TITLE_MEMO;
            ReportHelper            reportHelper    = new ReportHelper(gridControl, _ProgramID, _ReportTitle);
            CommonReportLandscapeA4 reportLandscape = new CommonReportLandscapeA4(); //橫向A4

            reportLandscape.printableComponentContainerMain.PrintableComponent = gcMain;

            reportLandscape.IsHandlePersonVisible = IsHandlePersonVisible;
            reportLandscape.IsManagerVisible      = IsManagerVisible;
            reportHelper.Create(reportLandscape);

            if (dtChange != null)
            {
                if (dtChange.Rows.Count != 0)
                {
                    gridControlPrint.DataSource     = dtChange;
                    reportHelper.PrintableComponent = gridControlPrint;
                    reportHelper.ReportTitle        = _ReportTitle + systemType;

                    reportHelper.Print();
                    reportHelper.Export(FileType.PDF, reportHelper.FilePath);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Genera el reporte
        /// </summary>
        /// <param name="ddlCurso"></param>
        /// <returns></returns>
        public ActionResult GenerarReporteCursosUsuarios(long ddlCurso)
        {
            DataTable tabla = CursoUsuarioLogic.GetForReport(ddlCurso);

            string mime = string.Empty;


            // -- Obtengo usuario logueado
            var usuarioLogueado = SessionManager.Get <Usuario>(Global.SessionsKeys.USER_SESSION);
            // -- Obtengo curso
            var curso = logic.GetByID(ddlCurso);

            // -- Agrego parametro
            var parameters = new List <Microsoft.Reporting.WebForms.ReportParameter>
            {
                new Microsoft.Reporting.WebForms.ReportParameter("Empresa", usuarioLogueado.Empresa.Nombre),
                new Microsoft.Reporting.WebForms.ReportParameter("Curso", curso.Nombre)
            };

            //genera los bytes del reporte a ser enviado al browser
            var bytes = ReportHelper.Create(System.AppDomain.CurrentDomain.BaseDirectory + @"Reportes\Rdlcs\CursosUsuarios.rdlc", tabla, parameters, "CursosUsuarios", ref mime);


            return(File(bytes, mime));
        }
Exemplo n.º 4
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            try {
                string footerMemo  = "";
                string txtFilePath = System.IO.Path.Combine(GlobalInfo.DEFAULT_EXCEL_TEMPLATE_DIRECTORY_PATH, _ProgramID + ".txt");
                using (System.IO.TextReader tr = new System.IO.StreamReader(txtFilePath, System.Text.Encoding.Default)) {
                    string line = "";
                    while ((line = tr.ReadLine()) != null)
                    {
                        footerMemo += line + Environment.NewLine;
                    }
                }

                gvMain.BestFitColumns(); //避免列印時字被吃掉

                ReportHelper            _ReportHelper   = new ReportHelper(gcMain, _ProgramID, this.Text);
                CommonReportLandscapeA4 reportLandscape = new CommonReportLandscapeA4();//設定為橫向列印
                reportLandscape.printableComponentContainerMain.PrintableComponent = gcMain;
                reportLandscape.IsHandlePersonVisible = false;
                reportLandscape.IsManagerVisible      = false;
                _ReportHelper.FooterMemo = footerMemo;
                _ReportHelper.Create(reportLandscape);

                _ReportHelper.Print();//如果有夜盤會特別標註
                _ReportHelper.Export(FileType.PDF, _ReportHelper.FilePath);

                return(ResultStatus.Success);
            } catch (Exception ex) {
                WriteLog(ex);
            }
            return(ResultStatus.Fail);
        }
Exemplo n.º 5
0
        protected override ResultStatus Print(ReportHelper ReportHelper)
        {
            try {
                ReportHelper            reportHelper      = new ReportHelper(gcMain, _ProgramID, _ProgramID + _ProgramName);
                CommonReportLandscapeA4 reportLandscapeA4 = new CommonReportLandscapeA4();//設定為橫向列印

                /*
                 * //寫入所有備註,備註由6個Label組成
                 * Label label;
                 * StringBuilder Memo = new StringBuilder("");
                 * for (int x = 1; x <= 6; x++) {
                 * if (this.Controls.Find("label" + x, true).Any() && this.Controls.Find("label" + x, true)[0] is Label) {
                 *    label = (Label)this.Controls.Find("label" + x, true)[0];
                 *    Memo.AppendLine(label.Text);
                 * }
                 * }
                 *
                 * reportHelper.FooterMemo = Memo.ToString();
                 */
                reportHelper.FooterMemo = printMemo.Text;
                reportHelper.Create(reportLandscapeA4);
                reportHelper.Print();
            }
            catch (Exception ex) {
                throw ex;
            }
            return(ResultStatus.Success);
        }
Exemplo n.º 6
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            try {
                ReportHelper           _ReportHelper    = new ReportHelper(gcMain, _ProgramID, this.Text);
                CommonReportPortraitA4 reportPortraitA4 = new CommonReportPortraitA4();
                reportPortraitA4.printableComponentContainerMain.PrintableComponent = gcMain;
                reportPortraitA4.IsHandlePersonVisible = false;
                reportPortraitA4.IsManagerVisible      = false;
                _ReportHelper.Create(reportPortraitA4);

                _ReportHelper.Print();

                _ReportHelper = new ReportHelper(gcMainE, _ProgramID, this.Text);
                reportPortraitA4.printableComponentContainerMain.PrintableComponent = gcMainE;
                reportPortraitA4.IsHandlePersonVisible = false;
                reportPortraitA4.IsManagerVisible      = false;
                _ReportHelper.Create(reportPortraitA4);

                _ReportHelper.Print();

                return(ResultStatus.Success);
            }
            catch (Exception ex) {
                WriteLog(ex);
            }
            return(ResultStatus.Fail);
        }
Exemplo n.º 7
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            ShowMsg("列印中...");
            try {
                CommonReportPortraitA4 reportPortraitA4 = new CommonReportPortraitA4();
                if (_defReport == null)
                {
                    _defReport = new defReport();
                }

                _defReport.SetMemoInPageFooter("註:★代表收盤前40秒間詢價");
                XtraReport xtraReport    = reportHelper.CreateCompositeReport(_defReport, reportPortraitA4);
                string     dateCondition = DateText() == "" ? "" : "," + DateText();
                reportHelper.LeftMemo = ConditionText() + dateCondition;
                reportHelper.Create(xtraReport);

                reportHelper.Print(reportHelper.MainReport);
                ShowReport(_defReport);
            }
            catch (Exception ex) {
                WriteLog(ex);
                throw ex;
            }
            finally {
                EndExport("列印完成!");
            }

            return(ResultStatus.Success);
        }
Exemplo n.º 8
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            ShowMsg("列印中...");
            try {
                CommonReportLandscapeA4 reportLandscapeA4 = new CommonReportLandscapeA4();
                if (_Report == null)
                {
                    _Report = new XtraReport();
                }
                XtraReport xtraReport    = reportHelper.CreateCompositeReport(_Report, reportLandscapeA4);
                string     dateCondition = DateText() == "" ? "" : "," + DateText();
                reportHelper.LeftMemo = ConditionText() + dateCondition;
                reportHelper.Create(xtraReport);

                reportHelper.Print(reportHelper.MainReport);
                ShowReport(_Report);//xtraReport列印後畫面會莫名被清空,所以重新讓它顯示
            }
            catch (Exception ex) {
                WriteLog(ex);
                throw ex;
            }
            finally {
                EndExport("列印完成!");
            }

            return(ResultStatus.Success);
        }
Exemplo n.º 9
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            try {
                //ReportHelper reportHelper = new ReportHelper(PrintableComponent, _ReportID, _ReportTitle);
                //reportHelper.FilePath = _DefaultFileNamePath;
                //reportHelper.FileType = FileType.PDF;
                //reportHelper.IsPrintedFromPrintButton = true;

                ReportHelper _ReportHelper = reportHelper;

                if (ddlData.EditValue.AsString() == "KeyInfo")
                {
                    //重點資料
                    CommonReportPortraitA4 reportPortrait = new CommonReportPortraitA4();//設定為直向列印
                    reportPortrait.printableComponentContainerMain.PrintableComponent = gcMain;
                    reportPortrait.IsHandlePersonVisible = false;
                    reportPortrait.IsManagerVisible      = false;
                    _ReportHelper.Create(reportPortrait);
                }
                else
                {
                    //明細資料,欄位比較多
                    CommonReportLandscapeA3 reportLandscape = new CommonReportLandscapeA3();//設定為橫向列印
                    reportLandscape.printableComponentContainerMain.PrintableComponent = gcMain;
                    reportLandscape.IsHandlePersonVisible = false;
                    reportLandscape.IsManagerVisible      = false;
                    _ReportHelper.Create(reportLandscape);
                }

                //寫一行標題的註解,通常是查詢條件
                string leftMemo = labDate.Text + txtSDate.Text.Trim() + labDateBetween.Text.Trim() + txtEDate.Text.Trim() + labDateUnit.Text + " , ";
                leftMemo += labSubType.Text + ddlSubType.Text + " , ";
                leftMemo += labData.Text + ddlData.Text + " , ";
                leftMemo += labSort.Text + ddlSort.Text;
                _ReportHelper.LeftMemo = leftMemo;

                _ReportHelper.Print();

                return(ResultStatus.Success);
            } catch (Exception ex) {
                WriteLog(ex);
            }
            return(ResultStatus.Fail);
        }
Exemplo n.º 10
0
        protected override ResultStatus Save(PokeBall poke)
        {
            gvMain.CloseEditor();
            gvMain.UpdateCurrentRow();
            ResultStatus resultStatus = ResultStatus.Fail;

            DataTable dt       = (DataTable)gcMain.DataSource;
            DataTable dtChange = dt.GetChanges();

            if (dtChange != null)
            {
                if (dtChange.Rows.Count == 0)
                {
                    MessageBox.Show("沒有變更資料,不需要存檔!", "注意", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(ResultStatus.FailButNext);
                }
                else
                {
                    //先刪除舊資料, 再新增資料
                    if (daoS0012.DeleteSP2S() >= 0)
                    {
                        DataTable insertSP2SData = daoS0012.GetSP2SColumns();
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            insertSP2SData.Rows.Add();
                            insertSP2SData.Rows[i]["SP2S_DATE"]       = dt.Rows[i]["SP1_DATE"];
                            insertSP2SData.Rows[i]["SP2S_TYPE"]       = dt.Rows[i]["SP1_TYPE"];
                            insertSP2SData.Rows[i]["SP2S_KIND_ID1"]   = dt.Rows[i]["SP1_KIND_ID1"];
                            insertSP2SData.Rows[i]["SP2S_KIND_ID2"]   = dt.Rows[i]["SP1_KIND_ID2"];
                            insertSP2SData.Rows[i]["SP2S_VALUE_DATE"] = txtCountDate.DateTimeValue;
                            insertSP2SData.Rows[i]["SP2S_OSW_GRP"]    = dt.Rows[i]["SP1_OSW_GRP"];
                            insertSP2SData.Rows[i]["SP2S_SPAN_CODE"]  = dt.Rows[i]["SP2_SPAN_CODE"];
                            insertSP2SData.Rows[i]["SP2S_ADJ_CODE"]   = "Y";
                            insertSP2SData.Rows[i]["SP2S_W_TIME"]     = DateTime.Now;
                            insertSP2SData.Rows[i]["SP2S_W_USER_ID"]  = GlobalInfo.USER_ID;
                            insertSP2SData.Rows[i]["SP2S_USER_CM"]    = dt.Rows[i]["SP1_USER_RATE"].AsDecimal() == 0 ? DBNull.Value : dt.Rows[i]["SP1_USER_RATE"];
                        }
                        resultStatus = daoS0012.updateData(insertSP2SData).Status;
                        if (resultStatus == ResultStatus.Success)
                        {
                            //儲存備份 pdf
                            ReportHelper            _ReportHelper   = new ReportHelper(gcMain, _ProgramID, this.Text);
                            CommonReportLandscapeA4 reportLandscape = new CommonReportLandscapeA4();//設定為橫向列印
                            reportLandscape.printableComponentContainerMain.PrintableComponent = gcMain;
                            reportLandscape.IsHandlePersonVisible = false;
                            reportLandscape.IsManagerVisible      = false;
                            _ReportHelper.Create(reportLandscape);

                            _ReportHelper.Export(FileType.PDF, _ReportHelper.FilePath);
                        }
                    }
                }
            }
            return(resultStatus);
        }
Exemplo n.º 11
0
        public override void ProcessPrintAll(ReportHelper reportHelper)
        {
            CommonReportPortraitA4 report = new CommonReportPortraitA4();

            report.IsHandlePersonVisible = false;
            report.IsManagerVisible      = false;
            reportHelper.Create(report);

            base.Print(reportHelper);
            MessageDisplay.Info(MessageDisplay.MSG_PRINT);
        }
Exemplo n.º 12
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            Retrieve();
            CommonReportLandscapeA4 report = new CommonReportLandscapeA4();

            reportHelper.Create(report);

            base.Print(reportHelper);

            return(ResultStatus.Success);
        }
Exemplo n.º 13
0
 /// <summary>
 /// 新增刪除修改後的列印
 /// </summary>
 /// <param name="reportHelper"></param>
 /// <param name="reportLandscapeA4"></param>
 private void ModifyPrint(ReportHelper reportHelper, CommonReportLandscapeA4 reportLandscapeA4)
 {
     if (reportHelper == null)
     {
         return;
     }
     reportHelper.FooterMemo = printMemo.Text;
     reportHelper.Create(reportLandscapeA4);
     reportHelper.Print();
     reportHelper.Export(FileType.PDF, reportHelper.FilePath);
 }
Exemplo n.º 14
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            _ReportHelper = reportHelper;
            CommonReportPortraitA4 report = new CommonReportPortraitA4();

            report.printableComponentContainerMain.PrintableComponent = gcMain;
            _ReportHelper.Create(report);

            base.Print(_ReportHelper);
            return(ResultStatus.Success);
        }
Exemplo n.º 15
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            _ReportHelper = reportHelper;
            CommonReportLandscapeA4 report = new CommonReportLandscapeA4();

            report.printableComponentContainerMain.PrintableComponent = gcMain;
            _ReportHelper.Create(report);
            //_ReportHelper.LeftMemo = "設定權限給(" + cbxUserId.Text.Trim() + ")";

            base.Print(_ReportHelper);
            return(ResultStatus.Success);
        }
Exemplo n.º 16
0
        private void btnPrintEmpty_Click(object sender, System.EventArgs e)
        {
            RZ0910_TXN report = new RZ0910_TXN("TXN_DEFAULT", "TXN_ID", "TXN_NAME");

            report.DataSource = gcMain.DataSource;
            string       reportTitle  = _ProgramID + "─空白作業權限表列印";
            string       reportId     = _ProgramID;;
            ReportHelper reportHelper = new ReportHelper(null, reportId, reportTitle);

            reportHelper.Create(report);
            base.Print(reportHelper);
        }
Exemplo n.º 17
0
        public override void ProcessPrintAll(ReportHelper reportHelper)
        {
            CommonReportLandscapeA4 report = new CommonReportLandscapeA4();

            report.IsHandlePersonVisible = false;
            report.IsManagerVisible      = false;
            reportHelper.Create(report);
            reportHelper.AddHeaderBottomInfo(_Condition);

            base.Print(reportHelper);
            MessageDisplay.Info(MessageDisplay.MSG_PRINT);
        }
Exemplo n.º 18
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            reportHelper.IsHandlePersonVisible = true;
            reportHelper.IsManagerVisible      = true;

            reportHelper.Create(GenerateReport());
            _ReportHelper = reportHelper;

            base.Print(reportHelper);

            return(ResultStatus.Success);
        }
Exemplo n.º 19
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            _ReportHelper = reportHelper;
            CommonReportPortraitA4 report = new CommonReportPortraitA4();

            _ReportHelper.IsHandlePersonVisible = true;
            _ReportHelper.IsManagerVisible      = true;
            _ReportHelper.Create(report);
            _ReportHelper.AddHeaderBottomInfo("設定作業項目權限:" + ddlTxnId.EditValue.AsString());

            base.Print(_ReportHelper);
            return(ResultStatus.Success);
        }
Exemplo n.º 20
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            _ReportHelper = reportHelper;
            CommonReportPortraitA4 report = new CommonReportPortraitA4();

            _ReportHelper.IsHandlePersonVisible = true;
            _ReportHelper.IsManagerVisible      = true;
            _ReportHelper.Create(report);
            _ReportHelper.LeftMemo = "設定權限給(" + ddlUserId.EditValue.AsString() + ")";

            base.Print(_ReportHelper);
            return(ResultStatus.Success);
        }
Exemplo n.º 21
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            try {
                _ReportHelper = reportHelper;
                CommonReportLandscapeA4 report = new CommonReportLandscapeA4();
                report.printableComponentContainerMain.PrintableComponent = gcMain;
                _ReportHelper.Create(report);

                base.Print(_ReportHelper);
            } catch (Exception ex) {
                WriteLog(ex);
            }
            return(ResultStatus.Success);
        }
Exemplo n.º 22
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            _ReportHelper = reportHelper;
            CommonReportLandscapeA4 report = new CommonReportLandscapeA4();

            report.printableComponentContainerMain.PrintableComponent = gcMain;
            _ReportHelper.Create(report);


            _ReportHelper.Print();//如果有夜盤會特別標註
            _ReportHelper.Export(FileType.PDF, _ReportHelper.FilePath);

            return(ResultStatus.Success);
        }
Exemplo n.º 23
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            ReportHelper            _ReportHelper   = new ReportHelper(gcMain, _ProgramID, this.Text);
            CommonReportLandscapeA4 reportLandscape = new CommonReportLandscapeA4();//設定為橫向列印

            reportLandscape.printableComponentContainerMain.PrintableComponent = gcMain;
            reportLandscape.IsHandlePersonVisible = false;
            reportLandscape.IsManagerVisible      = false;
            _ReportHelper.Create(reportLandscape);

            _ReportHelper.Print();
            _ReportHelper.Export(FileType.PDF, _ReportHelper.FilePath);
            return(ResultStatus.Success);
        }
Exemplo n.º 24
0
 protected override ResultStatus Print(ReportHelper ReportHelper)
 {
     try {
         ReportHelper = new ReportHelper(gcMain, "20231", "[20231] 部位限制個股類標的轉入-新增個股契約基本資料");
         CommonReportLandscapeA4 reportLandscape = new CommonReportLandscapeA4();//設定為橫向列印
         reportLandscape.IsHandlePersonVisible = false;
         reportLandscape.IsManagerVisible      = false;
         ReportHelper.Create(reportLandscape);
         ReportHelper.Print();
         ReportHelper.Export(FileType.PDF, ReportHelper.FilePath);
     } catch (Exception ex) {
         throw ex;
     }
     return(ResultStatus.Success);
 }
Exemplo n.º 25
0
 protected override ResultStatus Print(ReportHelper reportHelper)
 {
     try {
         _ReportHelper = reportHelper;
         CommonReportPortraitA4 report = new CommonReportPortraitA4();
         report.printableComponentContainerMain.PrintableComponent = gcMain;
         _ReportHelper.Create(report);
         _ReportHelper.Export(FileType.PDF, _ReportHelper.FilePath);
         base.Print(_ReportHelper);
     } catch (Exception ex) {
         MessageDisplay.Error("列印失敗");
         throw ex;
     }
     return(ResultStatus.Success);
 }
Exemplo n.º 26
0
        /// <summary>
        /// 列印功能
        /// </summary>
        /// <param name="reportHelper"></param>
        /// <returns></returns>
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            //gcMain.Print();
            CommonReportLandscapeA4 rep = new CommonReportLandscapeA4();

            //如沒有查詢則不印出gvMain
            if (gvMain.RowCount != 0)
            {
                rep.printableComponentContainerMain.PrintableComponent = gcMain;
            }

            reportHelper.Create(rep);
            base.Print(reportHelper);

            return(ResultStatus.Success);
        }
Exemplo n.º 27
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            CommonReportPortraitA4 reportPortraitA4 = new CommonReportPortraitA4();

            if (_defReport == null)
            {
                _defReport = new defReport();
            }
            XtraReport xtraReport    = reportHelper.CreateCompositeReport(_defReport, reportPortraitA4);
            string     dateCondition = DateText() == "" ? "" : "," + DateText();

            reportHelper.LeftMemo = ConditionText() + dateCondition;
            reportHelper.Create(xtraReport);

            reportHelper.Print(reportHelper.MainReport);
            ShowReport(_defReport);//xtraReport列印後畫面會莫名被清空
            return(ResultStatus.Success);
        }
Exemplo n.º 28
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            try {
                ReportHelper            _ReportHelper   = new ReportHelper(gcDetail, _ProgramID, this.Text);
                CommonReportLandscapeA3 reportLandscape = new CommonReportLandscapeA3();//設定為橫向列印
                reportLandscape.printableComponentContainerMain.PrintableComponent = gcDetail;
                reportLandscape.IsHandlePersonVisible = false;
                reportLandscape.IsManagerVisible      = false;
                _ReportHelper.Create(reportLandscape);

                _ReportHelper.Print();//如果有夜盤會特別標註
                _ReportHelper.Export(FileType.PDF, _ReportHelper.FilePath);
                //MessageDisplay.Info("報表儲存完成!");
                return(ResultStatus.Success);
            } catch (Exception ex) {
                WriteLog(ex);
            }
            return(ResultStatus.Fail);
        }
Exemplo n.º 29
0
        protected override ResultStatus Print(ReportHelper reportHelper)
        {
            try {
                ReportHelper            _ReportHelper   = new ReportHelper(gcPrint, _ProgramID, this.Text);
                CommonReportLandscapeA4 reportLandscape = new CommonReportLandscapeA4();//設定為橫向列印
                _ReportHelper.LeftMemo = GenPrintMemo();
                reportLandscape.IsHandlePersonVisible = false;
                reportLandscape.IsManagerVisible      = false;
                _ReportHelper.Create(reportLandscape);

                _ReportHelper.Print();//如果有夜盤會特別標註
                _ReportHelper.Export(FileType.PDF, _ReportHelper.FilePath);

                return(ResultStatus.Success);
            } catch (Exception ex) {
                WriteLog(ex);
            }
            return(ResultStatus.Fail);
        }
Exemplo n.º 30
0
        protected void CheckPrint(GridControl gridControl, DataTable dtChange, int printSetp,
                                  bool IsHandlePersonVisible = true, bool IsManagerVisible = true)
        {
            try {
                GridControl gridControlPrint = GridHelper.CloneGrid(gridControl);

                ReportHelper reportHelper = new ReportHelper(gridControl, _ProgramID, this.Text);

                gridControlPrint.DataSource = dtChange;
                //reportHelper.PrintableComponent = gridControlPrint; // 加這行bands會不見
                if (printSetp == 1)
                {
                    reportHelper.ReportTitle           = this.Text + "─" + "(確認單)";
                    reportHelper.IsHandlePersonVisible = IsHandlePersonVisible;
                    reportHelper.IsManagerVisible      = IsManagerVisible;
                }
                else
                {
                    reportHelper.ReportTitle           = this.Text + "─" + "(已確認)";
                    reportHelper.IsHandlePersonVisible = false;
                    reportHelper.IsManagerVisible      = false;
                }

                CommonReportLandscapeA4 report = new CommonReportLandscapeA4(); //設定為橫向列印
                report.printableComponentContainerMain.PrintableComponent = gcMain;
                if (printSetp == 1)
                {
                    reportHelper.FooterMemo = "備    註:已下市契約之最小風險價格係數一律為空白;有效契約之最小風險價格係數不可為空白。";
                }
                else
                {
                    reportHelper.FooterMemo = null;
                }
                reportHelper.Create(report);

                //base.Print(reportHelper);
                reportHelper.Print();
                reportHelper.Export(FileType.PDF, reportHelper.FilePath);
            } catch (Exception ex) {
                WriteLog(ex);
            }
        }