diff --git a/WinForm/AppView/FormMain.Designer.cs b/WinForm/AppView/FormMain.Designer.cs index 6203a93..23e0035 100644 --- a/WinForm/AppView/FormMain.Designer.cs +++ b/WinForm/AppView/FormMain.Designer.cs @@ -43,6 +43,7 @@ componentDocumentWithChartBarWord = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarWord(components); pdfGeneratorControl = new PdfFormsLibrary.PdfGeneratorControl(components); circleDiagram = new WinFormsLibrary.CircleDiagram(components); + componentWithSettings = new WinFormsLibrary.not_visual.ComponentWithSettings(components); contextMenuStrip.SuspendLayout(); SuspendLayout(); // @@ -143,5 +144,6 @@ private ToolStripMenuItem открытьСправочникToolStripMenuItem; private PdfFormsLibrary.PdfGeneratorControl pdfGeneratorControl; private WinFormsLibrary.CircleDiagram circleDiagram; + private WinFormsLibrary.not_visual.ComponentWithSettings componentWithSettings; } } \ No newline at end of file diff --git a/WinForm/AppView/FormMain.cs b/WinForm/AppView/FormMain.cs index c40486e..d171f3a 100644 --- a/WinForm/AppView/FormMain.cs +++ b/WinForm/AppView/FormMain.cs @@ -22,6 +22,7 @@ using PdfFormsLibrary.Helpers; using WinFormsLibrary.SupportClasses; using WinFormsLibrary.SupportClasses.Enums; using DataBaseImplement.Models; +using WinFormsLibrary.not_visual; namespace AppView { @@ -192,7 +193,15 @@ namespace AppView provider.SupplyDateTime = provider.SupplyDate.ToString(); } - ComponentDocumentWithTableHeaderDataConfig config = new() + var columnConfigs = new List + { + new ColumnConfig { Width = 50f, PropertyName = "Id" }, + new ColumnConfig { Width = 50f, PropertyName = "Name" }, + new ColumnConfig { Width = 50f, PropertyName = "Type" }, + new ColumnConfig { Width = 70f, PropertyName = "SupplyDateTime" }, + }; + + /*ComponentDocumentWithTableHeaderDataConfig config = new() { Data = providersList, Headers = new() @@ -212,7 +221,7 @@ namespace AppView (10,10), }, ColumnsRowsDataCount = new() - }; + };*/ SaveFileDialog saveFileDialog = new() { @@ -220,12 +229,12 @@ namespace AppView }; if (saveFileDialog.ShowDialog() == DialogResult.OK) { - config.FilePath = saveFileDialog.FileName; + //config.FilePath = saveFileDialog.FileName; try { - - componentDocumentWithTableMultiHeaderExcel.CreateDoc(config); + componentWithSettings.GenerateExcelDocument(saveFileDialog.FileName, "Отчет по всем поставщикам", columnConfigs, 25f, 35f, providersList); + //componentDocumentWithTableMultiHeaderExcel.CreateDoc(config); MessageBox.Show( "Excel-документ успешно сохранен.", "Успех", @@ -273,7 +282,7 @@ namespace AppView }; if (saveFileDialog.ShowDialog() == DialogResult.OK) { - SimpleCircleDiagram simpleCircleDiagram = new(saveFileDialog.FileName, "Круговая диаграмма", "Количество поставщиков в разрезе типа организации", + SimpleCircleDiagram simpleCircleDiagram = new(saveFileDialog.FileName, "Круговая диаграмма", "Количество поставщиков в разрезе типа организации", EnumAreaLegend.Right, new() { new DataCircleDiagram("Типы организации", results.ToArray()) }); simpleCircleDiagram.NameData = names.ToArray(); try diff --git a/WinForm/AppView/FormMain.resx b/WinForm/AppView/FormMain.resx index cd80a44..d06b4da 100644 --- a/WinForm/AppView/FormMain.resx +++ b/WinForm/AppView/FormMain.resx @@ -75,4 +75,7 @@ 456, 54 + + 582, 54 + \ No newline at end of file