From 9de3a512ef2db78cef99a0cfa024e9074188650c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=90=D0=BB=D0=B5=D0=B9?= =?UTF-8?q?=D0=BA=D0=B8=D0=BD?= Date: Thu, 30 Nov 2023 00:50:03 +0400 Subject: [PATCH] =?UTF-8?q?Pdf=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WinFormsProject/AppView/FormMain.Designer.cs | 4 ++- WinFormsProject/AppView/FormMain.cs | 33 ++++++++++++++++++++ WinFormsProject/AppView/FormMain.resx | 3 ++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/WinFormsProject/AppView/FormMain.Designer.cs b/WinFormsProject/AppView/FormMain.Designer.cs index 4db6094..72e4b40 100644 --- a/WinFormsProject/AppView/FormMain.Designer.cs +++ b/WinFormsProject/AppView/FormMain.Designer.cs @@ -39,6 +39,7 @@ 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.contextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -62,7 +63,7 @@ this.сформироватьPdfToolStripMenuItem, this.сформироватьExcelToolStripMenuItem}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(205, 180); + this.contextMenuStrip1.Size = new System.Drawing.Size(205, 158); // // создатьToolStripMenuItem // @@ -138,5 +139,6 @@ private ToolStripMenuItem сформироватьPdfToolStripMenuItem; private ToolStripMenuItem сформироватьExcelToolStripMenuItem; private WinFormsLibrary.DocumentWithImage documentWithImage1; + private WinFormsLibrary.Table2column table2column1; } } \ No newline at end of file diff --git a/WinFormsProject/AppView/FormMain.cs b/WinFormsProject/AppView/FormMain.cs index 6d1142e..3e85a45 100644 --- a/WinFormsProject/AppView/FormMain.cs +++ b/WinFormsProject/AppView/FormMain.cs @@ -148,7 +148,40 @@ namespace AppView private void PdfToolStripMenuItem_Click(object sender, EventArgs e) { + System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); + string fileName = ""; + using (var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }) + { + if (dialog.ShowDialog() == DialogResult.OK) + { + fileName = dialog.FileName.ToString(); + MessageBox.Show("", "", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + } + + List columnDefinitionsUp = new List { + new ColumnDefinition{Header = "#", PropertyName = "Id", Weight = 30}, + new ColumnDefinition{Header = "", PropertyName = "NumberType", Weight = 30}, + new ColumnDefinition{Header = "", PropertyName = "NumberType", Weight = 30}, + new ColumnDefinition{Header = " ", PropertyName = "Number", Weight = 30}, + }; + List columnDefinitionsDown = new List { + new ColumnDefinition{Header = "#", PropertyName = "Id", Weight = 30}, + new ColumnDefinition{Header = "", PropertyName = "Name", Weight = 30}, + new ColumnDefinition{Header = " ", PropertyName = "Type", Weight = 30}, + new ColumnDefinition{Header = "-", PropertyName = "Number", Weight = 30}, + }; + + var orders = _providerStorage.GetFullList(); + + List mergedColums = new() { new int[] { 1, 2 } }; + + BigTable info = new(fileName, "Table", columnDefinitionsUp, columnDefinitionsDown, orders, mergedColums); + + table2column1.CreateTable(info); + MessageBox.Show(""); } } } \ No newline at end of file diff --git a/WinFormsProject/AppView/FormMain.resx b/WinFormsProject/AppView/FormMain.resx index f8d595d..a39f414 100644 --- a/WinFormsProject/AppView/FormMain.resx +++ b/WinFormsProject/AppView/FormMain.resx @@ -63,4 +63,7 @@ 172, 17 + + 345, 17 + \ No newline at end of file