示例#1
0
        /// <summary>
        /// 프린트 출력
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (dt.Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "출력할 데이터가 없습니다.");
                    return;
                }

                if (Basic.ShowMessageQuestion("출력하시겠습니까?") == DialogResult.No)
                {
                    return;
                }
                Basic.SetCursor(this, false);

                //찾는값
                string dateFrom = dtpFrom.Text.Trim();
                string dateTo   = dtpTo.Text.Trim();

                //모두일경우
                //if (this.txtName.Text.Trim() == "") p_grouprName = "*전체";


                //컬러명
                DataTable dtTemp = new DataTable("dtTitle");
                dtTemp.Columns.Add("dateFrom");
                dtTemp.Columns.Add("dateTo");

                //필드명
                dtTemp.Rows.Add(new object[] { dateFrom, dateTo });


                //필터링된 데이터를 담는다.
                DataTable dtFilter = Cls.Grid.Options.GetGridData(this.grid);

                //테이블 추가
                DataSet dsTemp = new DataSet();
                dsTemp.Tables.AddRange(new DataTable[] { dtFilter, dtTemp });

                //DxReport 추가
                f = new XtraReportsBase.DxReport.XtraPreviewForm();
                DevExpress.XtraReports.UI.XtraReport rpt = new Erp.Facility.JARA.Report.JMRAP23();
                f.ShowReport(dsTemp, rpt);
                f.Show();
            }

            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }

            finally
            {
                Basic.SetCursor(this, true);
            }
        }
示例#2
0
        /// <summary>
        /// 프린트 출력
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (dt.Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "출력할 데이터가 없습니다.");
                    return;
                }

                if (Basic.ShowMessageQuestion("출력하시겠습니까?") == DialogResult.No)
                {
                    return;
                }
                Basic.SetCursor(this, false);

                //찾는값
                string dateFrom = dtpFrom.Text.Trim();
                string dateTo   = dtpTo.Text.Trim();

                //컬러명
                DataTable dtTemp = new DataTable("dtDate");
                dtTemp.Columns.Add("DATE_FROM");
                dtTemp.Columns.Add("DATE_TO");

                //필드명
                dtTemp.Rows.Add(new object[] { dateFrom, dateTo });


                DataSet ds = new DataSet("xsd_JMRAS01");
                ds.Tables.AddRange(new DataTable[] { dt.Copy(),
                                                     dt2.Copy(),
                                                     dtTemp });
                //테이블 추가
                //DataSet dsTemp = new DataSet();
                //dsTemp.Tables.AddRange(new DataTable[] { dt.Copy(), dt2.Copy(), dtTemp });

                //DxReport 추가
                f = new XtraReportsBase.DxReport.XtraPreviewForm();
                DevExpress.XtraReports.UI.XtraReport rpt = new Erp.Facility.JARA.Report.JMRAP23();
                f.ShowReport(ds, rpt);
                f.Show();
            }

            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }

            finally
            {
                Basic.SetCursor(this, true);
            }
        }