Component Artyoma dont work

This commit is contained in:
user 2023-11-30 11:20:36 +04:00
parent 3704947e84
commit 280fcbba32
8 changed files with 149 additions and 85 deletions

View File

@ -11,6 +11,7 @@
<ItemGroup>
<PackageReference Include="ComponentsLibraryNet60" Version="1.0.0" />
<PackageReference Include="ControlsLibraryNet60" Version="1.0.0" />
<PackageReference Include="ExcelFormsLibrary" Version="1.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@ -20,7 +21,7 @@
<ItemGroup>
<ProjectReference Include="..\DateBaseImplement\DateBaseImplement.csproj" />
<ProjectReference Include="..\WinFormsLibrary\WinFormsLibrary.csproj" />
<ProjectReference Include="..\WinFormsLibrary\WinFormsLibraryAA.csproj" />
</ItemGroup>
</Project>

View File

@ -28,105 +28,98 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.dataTable = new ControlsLibraryNet60.Data.ControlDataTableTable();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.создатьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.изменитьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.удалитьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.справочникToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.сформирироватьWordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.сформироватьPdfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.сформироватьExcelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.documentWithImage1 = new WinFormsLibrary.DocumentWithImage(this.components);
this.table2column1 = new WinFormsLibrary.Table2column(this.components);
this.componentDocumentWithChartBarExcel1 = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel(this.components);
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
components = new System.ComponentModel.Container();
dataTable = new ControlsLibraryNet60.Data.ControlDataTableTable();
contextMenuStrip1 = new ContextMenuStrip(components);
создатьToolStripMenuItem = new ToolStripMenuItem();
изменитьToolStripMenuItem = new ToolStripMenuItem();
удалитьToolStripMenuItem = new ToolStripMenuItem();
справочникToolStripMenuItem = new ToolStripMenuItem();
сформирироватьWordToolStripMenuItem = new ToolStripMenuItem();
сформироватьPdfToolStripMenuItem = new ToolStripMenuItem();
сформироватьExcelToolStripMenuItem = new ToolStripMenuItem();
documentWithImage1 = new WinFormsLibrary.DocumentWithImage(components);
table2column1 = new WinFormsLibrary.Table2column(components);
componentDocumentWithChartBarExcel1 = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel(components);
gistograma1 = new WinFormsLibrary.not_visual.Gistograma(components);
contextMenuStrip1.SuspendLayout();
SuspendLayout();
//
// dataTable
//
this.dataTable.Location = new System.Drawing.Point(13, 12);
this.dataTable.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.dataTable.Name = "dataTable";
this.dataTable.SelectedRowIndex = -1;
this.dataTable.Size = new System.Drawing.Size(774, 426);
this.dataTable.TabIndex = 0;
dataTable.Location = new Point(13, 12);
dataTable.Margin = new Padding(4, 3, 4, 3);
dataTable.Name = "dataTable";
dataTable.SelectedRowIndex = -1;
dataTable.Size = new Size(774, 426);
dataTable.TabIndex = 0;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.создатьToolStripMenuItem,
this.изменитьToolStripMenuItem,
this.удалитьToolStripMenuItem,
this.справочникToolStripMenuItem,
this.сформирироватьWordToolStripMenuItem,
this.сформироватьPdfToolStripMenuItem,
this.сформироватьExcelToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(205, 158);
contextMenuStrip1.Items.AddRange(new ToolStripItem[] { создатьToolStripMenuItem, изменитьToolStripMenuItem, удалитьToolStripMenuItem, справочникToolStripMenuItem, сформирироватьWordToolStripMenuItem, сформироватьPdfToolStripMenuItem, сформироватьExcelToolStripMenuItem });
contextMenuStrip1.Name = "contextMenuStrip1";
contextMenuStrip1.Size = new Size(205, 158);
//
// создатьToolStripMenuItem
//
this.создатьToolStripMenuItem.Name = "создатьToolStripMenuItem";
this.создатьToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.создатьToolStripMenuItem.Text = "Создать";
this.создатьToolStripMenuItem.Click += new System.EventHandler(this.создатьToolStripMenuItem_Click);
создатьToolStripMenuItem.Name = "создатьToolStripMenuItem";
создатьToolStripMenuItem.Size = new Size(204, 22);
создатьToolStripMenuItem.Text = "Создать";
создатьToolStripMenuItem.Click += создатьToolStripMenuItem_Click;
//
// изменитьToolStripMenuItem
//
this.изменитьToolStripMenuItem.Name = "изменитьToolStripMenuItem";
this.изменитьToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.изменитьToolStripMenuItem.Text = "Изменить";
this.изменитьToolStripMenuItem.Click += new System.EventHandler(this.изменитьToolStripMenuItem_Click);
изменитьToolStripMenuItem.Name = "изменитьToolStripMenuItem";
изменитьToolStripMenuItem.Size = new Size(204, 22);
изменитьToolStripMenuItem.Text = "Изменить";
изменитьToolStripMenuItem.Click += изменитьToolStripMenuItem_Click;
//
// удалитьToolStripMenuItem
//
this.удалитьToolStripMenuItem.Name = "удалитьToolStripMenuItem";
this.удалитьToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.удалитьToolStripMenuItem.Text = "Удалить";
this.удалитьToolStripMenuItem.Click += new System.EventHandler(this.удалитьToolStripMenuItem_Click);
удалитьToolStripMenuItem.Name = "удалитьToolStripMenuItem";
удалитьToolStripMenuItem.Size = new Size(204, 22);
удалитьToolStripMenuItem.Text = "Удалить";
удалитьToolStripMenuItem.Click += удалитьToolStripMenuItem_Click;
//
// справочникToolStripMenuItem
//
this.справочникToolStripMenuItem.Name = "справочникToolStripMenuItem";
this.справочникToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.справочникToolStripMenuItem.Text = "Справочник";
this.справочникToolStripMenuItem.Click += new System.EventHandler(this.справочникToolStripMenuItem_Click);
справочникToolStripMenuItem.Name = "справочникToolStripMenuItem";
справочникToolStripMenuItem.Size = new Size(204, 22);
справочникToolStripMenuItem.Text = "Справочник";
справочникToolStripMenuItem.Click += справочникToolStripMenuItem_Click;
//
// сформирироватьWordToolStripMenuItem
//
this.сформирироватьWordToolStripMenuItem.Name = "сформирироватьWordToolStripMenuItem";
this.сформирироватьWordToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.сформирироватьWordToolStripMenuItem.Text = "Сформирировать Word";
this.сформирироватьWordToolStripMenuItem.Click += new System.EventHandler(this.сформирироватьWordToolStripMenuItem_Click);
сформирироватьWordToolStripMenuItem.Name = "сформирироватьWordToolStripMenuItem";
сформирироватьWordToolStripMenuItem.Size = new Size(204, 22);
сформирироватьWordToolStripMenuItem.Text = "Сформирировать Word";
сформирироватьWordToolStripMenuItem.Click += сформирироватьWordToolStripMenuItem_Click;
//
// сформироватьPdfToolStripMenuItem
//
this.сформироватьPdfToolStripMenuItem.Name = "сформироватьPdfToolStripMenuItem";
this.сформироватьPdfToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.сформироватьPdfToolStripMenuItem.Text = "Сформировать Pdf";
this.сформироватьPdfToolStripMenuItem.Click += new System.EventHandler(this.сформироватьPdfToolStripMenuItem_Click);
сформироватьPdfToolStripMenuItem.Name = "сформироватьPdfToolStripMenuItem";
сформироватьPdfToolStripMenuItem.Size = new Size(204, 22);
сформироватьPdfToolStripMenuItem.Text = "Сформировать Pdf";
сформироватьPdfToolStripMenuItem.Click += сформироватьPdfToolStripMenuItem_Click;
//
// сформироватьExcelToolStripMenuItem
//
this.сформироватьExcelToolStripMenuItem.Name = "сформироватьExcelToolStripMenuItem";
this.сформироватьExcelToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
this.сформироватьExcelToolStripMenuItem.Text = "Сформировать Excel";
this.сформироватьExcelToolStripMenuItem.Click += new System.EventHandler(this.сформироватьExcelToolStripMenuItem_Click);
сформироватьExcelToolStripMenuItem.Name = "сформироватьExcelToolStripMenuItem";
сформироватьExcelToolStripMenuItem.Size = new Size(204, 22);
сформироватьExcelToolStripMenuItem.Text = "Сформировать Excel";
сформироватьExcelToolStripMenuItem.Click += сформироватьExcelToolStripMenuItem_Click;
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.dataTable);
this.Name = "FormMain";
this.Text = "Главная форма";
this.Load += new System.EventHandler(this.FormMain_Load);
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(dataTable);
Name = "FormMain";
Text = "Главная форма";
Load += FormMain_Load;
contextMenuStrip1.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
@ -143,5 +136,6 @@
private WinFormsLibrary.DocumentWithImage documentWithImage1;
private WinFormsLibrary.Table2column table2column1;
private ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel componentDocumentWithChartBarExcel1;
private WinFormsLibrary.not_visual.Gistograma gistograma1;
}
}

View File

@ -6,6 +6,7 @@ using ControlsLibraryNet60.Models;
using DocumentFormat.OpenXml.Drawing.Charts;
using System.ComponentModel;
using WinFormsLibrary;
using WinFormsLibrary.not_visual;
using WinFormsLibrary.SupportClasses;
namespace AppView
@ -202,30 +203,35 @@ namespace AppView
var uniqueTypes = providers.Select(p => p.Type).Distinct();
Dictionary<string, List<(int Date, double Value)>> data = new Dictionary<string, List<(int Date, double Value)>>();
List<ChartData> data = new List<ChartData>();
foreach (var uniqueType in uniqueTypes)
{
var typeProviders = providers.Where(p => p.Type == uniqueType).ToList();
var dataList = new List<(int Date, double Value)>();
var dataList = new List<double>();
for (int i = 0; i < typeProviders.Count; i++)
{
dataList.Add((i + 1, i + 1)); // Ïðîñòî ïðèìåð äàííûõ (Date, Value), âû ìîæåòå èñïîëüçîâàòü ñâîè äàííûå
dataList.Add(i + 1); // Ïðîñòî ïðèìåð äàííûõ (Date, Value), âû ìîæåòå èñïîëüçîâàòü ñâîè äàííûå
}
ChartData chData = new ChartData();
chData.SeriesName = uniqueType;
chData.Data = dataList.ToArray();
data.Add(chData);
}
data.Add(uniqueType, dataList);
}
gistograma1.GenerateExcelChartDocument(fileName, "Ñâîäêà ïî òèïàì èçäåëèÿ.", "Êîëè÷åñòâî ïîñòàâùèêîâ äëÿ òîâàðîâ êàæäîãî òèïà", WinFormsLibrary.not_visual.LegendPosition.Bottom, data);
componentDocumentWithChartBarExcel1.CreateDoc(new ComponentDocumentWithChartConfig()
/*componentDocumentWithChartBarExcel1.CreateDoc(new ComponentDocumentWithChartConfig()
{
FilePath = fileName,
Header = "Ñâîäêà ïî òèïàì èçäåëèÿ.",
ChartTitle = "Êîëè÷åñòâî ïîñòàâùèêîâ äëÿ òîâàðîâ êàæäîãî òèïà",
LegendLocation = ComponentsLibraryNet60.Models.Location.Bottom,
Data = data
});
});*/
}
}
}

View File

@ -1,4 +1,64 @@
<root>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -69,4 +129,7 @@
<metadata name="componentDocumentWithChartBarExcel1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>478, 17</value>
</metadata>
<metadata name="gistograma1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>754, 17</value>
</metadata>
</root>

View File

@ -5,15 +5,15 @@ VisualStudioVersion = 17.3.32819.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsProject", "WinFormsProject\WinFormsProject.csproj", "{1FC6ABE3-DF27-453A-B2EE-FA17C71C9CF0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsLibrary", "WinFormsLibrary\WinFormsLibrary.csproj", "{CF6B5601-DC60-48A2-8BDC-1CE32E3F6F15}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsLibraryAA", "WinFormsLibrary\WinFormsLibraryAA.csproj", "{CF6B5601-DC60-48A2-8BDC-1CE32E3F6F15}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataModels", "DataModels\DataModels.csproj", "{23F0E442-0283-4192-A17B-D13D0C01C10D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataModels", "DataModels\DataModels.csproj", "{23F0E442-0283-4192-A17B-D13D0C01C10D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contracts", "Contracts\Contracts.csproj", "{6A196E6B-91D9-4873-9E5F-0D96D18A74F5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contracts", "Contracts\Contracts.csproj", "{6A196E6B-91D9-4873-9E5F-0D96D18A74F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DateBaseImplement", "DateBaseImplement\DateBaseImplement.csproj", "{F53D2EB4-F1EB-4C24-987C-CCC6BFC5FAD7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DateBaseImplement", "DateBaseImplement\DateBaseImplement.csproj", "{F53D2EB4-F1EB-4C24-987C-CCC6BFC5FAD7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppView", "AppView\AppView.csproj", "{294B81DD-546F-40AD-9BCE-0F51F1D17D1A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppView", "AppView\AppView.csproj", "{294B81DD-546F-40AD-9BCE-0F51F1D17D1A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -30,7 +30,7 @@ namespace WinFormsProject
private void button1_Click(object sender, EventArgs e)
{
testArray = new List<string>() {
/*testArray = new List<string>() {
"C:\\Users\\user\\Desktop\\images\\car_img1.png",
"C:\\Users\\user\\Desktop\\images\\car_img2.png",
};
@ -53,7 +53,7 @@ namespace WinFormsProject
{
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}*/
}
private void button2_Click(object sender, EventArgs e)

View File

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\WinFormsLibrary\WinFormsLibrary.csproj" />
<ProjectReference Include="..\WinFormsLibrary\WinFormsLibraryAA.csproj" />
</ItemGroup>
</Project>