예제 #1
0
        /// <summary>
        /// 조회된 결과 화면 보여주는 메서드
        /// </summary>
        private void ResultViewer()
        {
            uiTab_Main.Controls.Clear();

            Common.uiList = new Dictionary <string, List <Control> >();

            foreach (KeyValuePair <string, string> item in this._rItemDic)
            {
                //탭 페이지 생성
                TabPage tp = new TabPage(item.Value);
                tp.AutoScroll = true;

                UI.MainUi mainUi = new UI.MainUi();

                mainUi.opt   = AddSearchOption(); //조회조건 정보 저장
                mainUi.Width = uiTab_Main.Width - 20;
                mainUi.RItem = item.Value;
                mainUi.Dock  = DockStyle.Fill;

                //Tab Page 추가
                tp.Controls.Add(mainUi);

                uiTab_Main.Controls.Add(tp);
            }
        }
예제 #2
0
 /// <summary>
 /// 자동조회 Timer 동작 메서드
 /// </summary>
 public void AutoSearchViewer_Run()
 {
     for (int i = 0; i < uiTab_Main.TabPages.Count; i++)
     {
         UI.MainUi maunUi = uiTab_Main.TabPages[i].Controls[0] as UI.MainUi;
         maunUi.UpdateChart();
     }
 }
예제 #3
0
        /// <summary>
        /// 엑셀로 출력
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UiPb_SaveExcel_Click(object sender, EventArgs e)
        {
            string date     = DateTime.Now.ToString("yyyyMMdd_HHmmss");
            string fileName = $"BeomBeomJoJo_RTMS_{date}.xls";
            string ext      = ".xls";
            string filter   = "Microsoft Excel Workbook (*.xls)|*.xls";

            using (SaveFileDialog saveFileDialog = Function.GetExcelSaveFileDialog(fileName, ext, filter))
            {
                if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;

                    FarPoint.Win.Spread.FpSpread fs = new FarPoint.Win.Spread.FpSpread();
                    fs.Sheets.Count = uiTab_Main.Controls.Count;
                    FarPoint.Win.Spread.CellType.ImageCellType imgCell = new FarPoint.Win.Spread.CellType.ImageCellType();
                    imgCell.Style = FarPoint.Win.RenderStyle.Stretch;

                    for (int row = 0; row < uiTab_Main.Controls.Count; ++row)
                    {
                        UI.MainUi ui = uiTab_Main.TabPages[row].Controls[0] as UI.MainUi;

                        fs.Sheets[row].Columns.Count       = 1;
                        fs.Sheets[row].Columns[0].CellType = imgCell;

                        fs.Sheets.Add(ui);

                        if (ui == null)
                        {
                            continue;
                        }

                        using (Graphics g = ui.CreateGraphics())
                        {
                            Bitmap memBitMap = new Bitmap(ui.Width, ui.Height);
                            ui.DrawToBitmap(memBitMap, new Rectangle(0, 0, ui.Width, ui.Height));
                            g.DrawImageUnscaled(memBitMap, 0, 0);

                            fs.Sheets[row].Rows.Count        = 1;
                            fs.Sheets[row].Columns[0].Width  = 1500;
                            fs.Sheets[row].Rows[0].Height    = 800;
                            fs.Sheets[row].Cells[0, 0].Value = memBitMap.Clone();

                            memBitMap.Dispose();
                        }

                        fs.Sheets[row].SheetName = ui.RItem;
                    }

                    if (Function.ExportExcelFile(saveFileDialog.FileName, fs) == true)
                    {
                        JKMessageBox.ShowExcel(this, saveFileDialog.FileName);
                    }

                    this.Cursor = Cursors.Default;
                }
            }
        }