프로젝트

일반

사용자정보

개정판 cbf28e29

IDcbf28e2907836d5812b55a2d3faab4702812a38c
상위 f25fc1d9
하위 a72d2650

semi 이(가) 4년 이상 전에 추가함

Excel 바탕화면 흰색, Excel저장할때 파일명_날짜

Change-Id: Ifc93264d9bf8db0bb2a2d434a2e1274ce1410314

차이점 보기:

ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/FinalPDFExcelDialogViewModel.cs
127 127
        {
128 128
            SaveFileDialog saveFileDialog = new SaveFileDialog();
129 129

  
130
            saveFileDialog.FileName = "Document"; 
131
            saveFileDialog.DefaultExt = ".txt"; 
132
            saveFileDialog.Filter = "Csv documents (.Csv)|*.csv|Excel(2017~2019)Worksheets|*.xlsx"; 
130
            var today = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss");
131

  
132
            saveFileDialog.FileName = "Final_" + today;
133
            saveFileDialog.Title = "Final_" + today;
134
            saveFileDialog.DefaultExt = ".txt";
135
            saveFileDialog.CreatePrompt = true;
136
            saveFileDialog.OverwritePrompt = false;
137
            saveFileDialog.CheckFileExists = false;
138
            saveFileDialog.CheckPathExists = false;
139
            saveFileDialog.Filter = "Csv documents (.Csv)|*.csv|Excel(2017~2019)Worksheets|*.xlsx";
140
            saveFileDialog.FilterIndex = 2;
141
            saveFileDialog.RestoreDirectory = true;
133 142

  
134 143
            if (saveFileDialog.ShowDialog() == true)
135 144
            {
145
                string filename = saveFileDialog.FileName;
146

  
147
                if (saveFileDialog.FileName.Contains("\\"))
148
                {
149
                    filename = saveFileDialog.FileName.Substring(saveFileDialog.FileName.LastIndexOf("\\") + 1);
150
                }
151

  
152
                filename = saveFileDialog.FileName.Replace(filename, "Final_" + today);
153

  
136 154
                if (!string.IsNullOrWhiteSpace(saveFileDialog.FileName))
137 155
                {
156

  
138 157
                    var extension = new System.IO.FileInfo(saveFileDialog.FileName).Extension;
139 158

  
140 159
                    if (extension == ".xlsx" || extension == ".csv")
......
149 168
                        }
150 169

  
151 170
                        DataExport dataExport = new DataExport();
152
                        dataExport.DataExportExcel(saveFileDialog.FileName, "Final PDF", ExcelSource, headers);
171
                        dataExport.DataExportExcel(filename + extension, "Final PDF", ExcelSource, headers);//saveFileDialog.FileName
153 172
                    }
154 173
                }
155 174
            }

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)