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