From a3edd285d7757b06d3e9c325f9fb8f863917a75f Mon Sep 17 00:00:00 2001 From: maxnes3 <112558334+maxnes3@users.noreply.github.com> Date: Thu, 2 Nov 2023 09:38:50 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=20=D0=B4=D1=80=D1=83=D0=B3=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=B8?= =?UTF-8?q?=D0=B1=D0=B8=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WinForm/AppView/FormMain.Designer.cs | 2 ++ WinForm/AppView/FormMain.cs | 21 +++++++++++++++------ WinForm/AppView/FormMain.resx | 3 +++ 3 files changed, 20 insertions(+), 6 deletions(-) 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