Работает компонент другого дибила

This commit is contained in:
maxnes3 2023-11-02 09:38:50 +04:00
parent 3df672c516
commit a3edd285d7
3 changed files with 20 additions and 6 deletions

View File

@ -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;
}
}

View File

@ -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<ProviderViewModel> config = new()
var columnConfigs = new List<ColumnConfig>
{
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<ProviderViewModel> 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

View File

@ -75,4 +75,7 @@
<metadata name="circleDiagram.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>456, 54</value>
</metadata>
<metadata name="componentWithSettings.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>582, 54</value>
</metadata>
</root>