public void ExportStarted(object sender, ExportStartedEventHandlerArgs e)
 {
     for (int i = 0; i < bSpread.ActiveSheet.Rows.Count; i++)
     {
         bSpread.ActiveSheet.Rows[i].ResetBackColor();
     }
 }
示例#2
0
        public void Export(string folderPath, string startDtts, string endDtts)
        {
            var exportStartedArgs = new ExportStartedEventHandlerArgs();

            exportStartedArgs.folderPath   = folderPath;
            exportStartedArgs.mainModelNum = this.spcModelDataExports.Count;
            exportStartedEvent(this, exportStartedArgs);

            string[] fileName = new string[spcModelDataExports.Count];

            //파일명 유효성 검사
            for (int i = 0; i < spcModelDataExports.Count; i++)
            {
                fileName[i] = spcModelDataExports[i].SPCModelName;
                foreach (char ch in System.IO.Path.GetInvalidFileNameChars())
                {
                    if (spcModelDataExports[i].SPCModelName.Contains(ch.ToString()))
                    {
                        string[] str = fileName[i].Split(ch);
                        fileName[i] = string.Join("", str);
                    }
                }

                //foreach (char ch in System.IO.Path.GetInvalidFileNameChars())
                //{
                //    this.controller.spcModelDataExports[i].SPCModelName = this.controller.spcModelDataExports[i].SPCModelName.Replace(ch, '_');
                //}
            }

            if (!folderPath.EndsWith(@"\"))
            {
                folderPath += @"\";
            }

            string dateTime  = DateTime.Now.ToString("yyyyMMddHHmmss");
            int    iTotalCnt = 0;

            for (int i = 0; i < spcModelDataExports.Count; i++)
            {
                spcModelDataExports[i].modelExportCompletedEvent    -= export_modelExportCompletedEvent;
                spcModelDataExports[i].subModelExportCompletedEvent -= export_subModelExportCompletedEvent;
                spcModelDataExports[i].modelExportStartedEvent      -= DataExportController_modelExportStartedEvent;

                spcModelDataExports[i].modelExportCompletedEvent    += export_modelExportCompletedEvent;
                spcModelDataExports[i].subModelExportCompletedEvent += export_subModelExportCompletedEvent;
                spcModelDataExports[i].modelExportStartedEvent      += DataExportController_modelExportStartedEvent;

                string filePath = folderPath + fileName[i] + "_" + dateTime + ".xls";
                iTotalCnt += spcModelDataExports[i].Export(filePath, startDtts, endDtts);
            }

            var exportCompletedArgs = new ExportCompletedEventHandlerArgs();

            exportCompletedArgs.exportedModelNum = iTotalCnt;
            exportCompletedEvent(this, exportCompletedArgs);
        }
示例#3
0
        void DataExportUC_exportStartedEvent(object sender, ExportStartedEventHandlerArgs e)
        {
            this.pbarMain.Value   = 0;
            this.pbarSub.Value    = 0;
            this.pbarMain.Maximum = e.mainModelNum;
            this.blblMain.Text    = "0 / " + e.mainModelNum;
            this.blblSub.Text     = "0 / 0";

            if (exportStartedEventHandler != null)
            {
                exportStartedEventHandler(sender, e);
            }

            System.Threading.Thread.Sleep(50);
            Application.DoEvents();
        }
示例#4
0
        public void ExportStarted(object sender, ExportStartedEventHandlerArgs e)
        {
            InitializeSpread();

            btxtSavedPath.Text = e.folderPath;
        }
示例#5
0
 public void ExportStarted(object sender, ExportStartedEventHandlerArgs e)
 {
     this.exportResult1.ExportStarted(sender, e);
     this.spcModelUC1.ExportStarted(sender, e);
 }