Пример #1
0
        private void allBarDiagramBtn_Click(object sender, EventArgs e)//+
        {
            if (Document != null)
            {
                try
                {
                    string dirPath    = CommonService.GetFolderPath();
                    string newDirPath = string.Empty;
                    if (dirPath != null)
                    {
                        newDirPath = ProccesingDataService.GroupDiagramSave(Document, dirPath, SeriesChartType.Bar);

                        Dictionary <string, ExcelProfile> excelProfileMap = new Dictionary <string, ExcelProfile>();
                        foreach (var excelProfileItem in Document.ProfilesListContent)
                        {
                            excelProfileMap.Add(excelProfileItem.Name, excelProfileItem);
                        }
                        DataManipulationService.SaveExcel("Опросы", "Ответы", excelProfileMap, Document, newDirPath + "\\" + Document.DocumentName + ".xlsx");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("Сначала необходимо загрузить анкету.");
            }
        }
Пример #2
0
        private void saveExcelBtn_Click(object sender, EventArgs e)//+
        {
            try
            {
                string infoFileName   = string.Empty;
                string resultFileName = string.Empty;
                Dictionary <string, ExcelProfile> excelProfileMap = null;

                using (SheetsSettigsForm ssf = new SheetsSettigsForm())
                {
                    ssf.Type     = "save";
                    ssf.Format   = "excel";
                    ssf.Document = Document;
                    ssf.ShowDialog();
                    if (ssf.Status)
                    {
                        infoFileName    = ssf.InfoFileName;
                        resultFileName  = ssf.ResultFileName;
                        excelProfileMap = ssf.ExcelProfileMap;
                    }
                    else
                    {
                        return;
                    }
                }
                string filePath = CommonService.SaveFilePath("*.xlsx|*.xlsx", Document.DocumentName);

                DataManipulationService.SaveExcel(infoFileName, resultFileName, excelProfileMap, Document, filePath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }