Add word table documemt creation

This commit is contained in:
abazov73 2023-11-30 01:45:08 +04:00
parent 295edcaaa9
commit 69b21488e6
4 changed files with 26 additions and 4 deletions

View File

@ -15,7 +15,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NevaevaLibrary" Version="1.0.0" />
<PackageReference Include="NevaevaLibrary" Version="2.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
</ItemGroup>

View File

@ -41,6 +41,7 @@
this.интересыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.controlDataTable = new ControlsLibraryNet60.Data.ControlDataTableTable();
this.excelImagesComponent = new AbazovViewComponents.LogicalComponents.ExcelImagesComponent(this.components);
this.wordTableComponentAccount = new NevaevaLibrary.LogicalComponents.WordTableComponent(this.components);
this.componentDocumentWithChartBarPdf = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarPdf(this.components);
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
@ -116,6 +117,7 @@
this.документСТаблицейToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
this.документСТаблицейToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
this.документСТаблицейToolStripMenuItem.Text = "Документ с таблицей";
this.документСТаблицейToolStripMenuItem.Click += new System.EventHandler(this.документСТаблицейToolStripMenuItem_Click);
//
// документСДиаграммойToolStripMenuItem
//
@ -173,6 +175,7 @@
private ToolStripMenuItem интересыToolStripMenuItem;
private ControlsLibraryNet60.Data.ControlDataTableTable controlDataTable;
private AbazovViewComponents.LogicalComponents.ExcelImagesComponent excelImagesComponent;
private NevaevaLibrary.LogicalComponents.WordTableComponent wordTableComponentAccount;
private ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarPdf componentDocumentWithChartBarPdf;
}
}

View File

@ -126,5 +126,21 @@ namespace AccountsApp
MessageBox.Show("Успех");
}
private void документСТаблицейToolStripMenuItem_Click(object sender, EventArgs e)
{
string path = AppDomain.CurrentDomain.BaseDirectory + "Аккаунты.docx";
List<(int, int)> merges = new List<(int, int)> { (1, 2) };
List<int> widths = new List<int> { 100, 100, 100, 100 };
List<(string, string)> headers = new List<(string, string)> {
("Id", "Идентификатор"),
("", "Личные данные"),
("Login", "Логин"),
("Email", "Эл. почта"),
("InterestName", "Выбранный интерес")
};
wordTableComponentAccount.createWithTable(path, "Список аккаунтов", merges, widths, headers, _logic.ReadList(null));
}
}
}

View File

@ -61,12 +61,15 @@
<value>17, 17</value>
</metadata>
<metadata name="excelImagesComponent.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>152, 0</value>
<value>162, 27</value>
</metadata>
<metadata name="wordTableComponentAccount.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>378, 27</value>
</metadata>
<metadata name="componentDocumentWithChartBarPdf.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>152, 17</value>
<value>639, 27</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>54</value>
<value>90</value>
</metadata>
</root>