From d5bfbdfd58a0e72a73a265f5c79c163f48ef256b Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Sat, 25 Mar 2023 22:15:01 +0400 Subject: [PATCH 01/23] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BD=D0=B0=20=D1=84=D0=BE=D1=80=D0=BC?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FurnitureAssembly/FormMain.Designer.cs | 94 ++++++++++++------- .../FurnitureAssembly/FormMain.cs | 14 +++ 2 files changed, 75 insertions(+), 33 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs index b1fc110..f841985 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs @@ -38,12 +38,15 @@ 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.пополнениеМагазинаToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FurnituresToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FurnituresComponentsToolStripMenuItem = 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.ShopsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ShopsFurnituresToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OrderDateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.buttonSell = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.menuStrip1.SuspendLayout(); @@ -144,37 +147,6 @@ this.изделияToolStripMenuItem.Text = "Изделия"; this.изделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click); // - // отчетыToolStripMenuItem - // - this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.FurnituresToolStripMenuItem, - this.FurnituresComponentsToolStripMenuItem, - this.списокЗаказовToolStripMenuItem}); - this.отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; - this.отчетыToolStripMenuItem.Size = new System.Drawing.Size(60, 20); - this.отчетыToolStripMenuItem.Text = "Отчеты"; - // - // FurnituresToolStripMenuItem - // - this.FurnituresToolStripMenuItem.Name = "FurnituresToolStripMenuItem"; - this.FurnituresToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.FurnituresToolStripMenuItem.Text = "Список изделий"; - this.FurnituresToolStripMenuItem.Click += new System.EventHandler(this.FurnituresToolStripMenuItem_Click); - // - // FurnituresComponentsToolStripMenuItem - // - this.FurnituresComponentsToolStripMenuItem.Name = "FurnituresComponentsToolStripMenuItem"; - this.FurnituresComponentsToolStripMenuItem.Size = new System.Drawing.Size(216, 22); - this.FurnituresComponentsToolStripMenuItem.Text = "Изделия по компонентам"; - this.FurnituresComponentsToolStripMenuItem.Click += new System.EventHandler(this.FurnitureComponentsToolStripMenuItem_Click); - // - // списокЗаказовToolStripMenuItem - // - this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; - this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(218, 22); - this.списокЗаказовToolStripMenuItem.Text = "Список заказов"; - this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.OrdersToolStripMenuItem_Click); - // // магазиныToolStripMenuItem // this.магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; @@ -189,6 +161,59 @@ this.пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина"; this.пополнениеМагазинаToolStripMenuItem.Click += new System.EventHandler(this.ReplenishmentToolStripMenuItem_Click); // + // отчетыToolStripMenuItem + // + this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.FurnituresToolStripMenuItem, + this.FurnituresComponentsToolStripMenuItem, + this.списокЗаказовToolStripMenuItem, + this.ShopsToolStripMenuItem, + this.ShopsFurnituresToolStripMenuItem, + this.OrderDateToolStripMenuItem}); + this.отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; + this.отчетыToolStripMenuItem.Size = new System.Drawing.Size(60, 20); + this.отчетыToolStripMenuItem.Text = "Отчеты"; + // + // FurnituresToolStripMenuItem + // + this.FurnituresToolStripMenuItem.Name = "FurnituresToolStripMenuItem"; + this.FurnituresToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.FurnituresToolStripMenuItem.Text = "Список изделий"; + this.FurnituresToolStripMenuItem.Click += new System.EventHandler(this.FurnituresToolStripMenuItem_Click); + // + // FurnituresComponentsToolStripMenuItem + // + this.FurnituresComponentsToolStripMenuItem.Name = "FurnituresComponentsToolStripMenuItem"; + this.FurnituresComponentsToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.FurnituresComponentsToolStripMenuItem.Text = "Изделия по компонентам"; + this.FurnituresComponentsToolStripMenuItem.Click += new System.EventHandler(this.FurnitureComponentsToolStripMenuItem_Click); + // + // списокЗаказовToolStripMenuItem + // + this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; + this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.списокЗаказовToolStripMenuItem.Text = "Список заказов"; + this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.OrdersToolStripMenuItem_Click); + // + // ShopsToolStripMenuItem + // + this.ShopsToolStripMenuItem.Name = "ShopsToolStripMenuItem"; + this.ShopsToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.ShopsToolStripMenuItem.Text = "Список магазинов"; + this.ShopsToolStripMenuItem.Click += new System.EventHandler(this.ShopsToolStripMenuItem_Click_1); + // + // ShopsFurnituresToolStripMenuItem + // + this.ShopsFurnituresToolStripMenuItem.Name = "ShopsFurnituresToolStripMenuItem"; + this.ShopsFurnituresToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.ShopsFurnituresToolStripMenuItem.Text = "Изделия в магазинах"; + // + // OrderDateToolStripMenuItem + // + this.OrderDateToolStripMenuItem.Name = "OrderDateToolStripMenuItem"; + this.OrderDateToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.OrderDateToolStripMenuItem.Text = "Список заказов по датам"; + // // buttonSell // this.buttonSell.Location = new System.Drawing.Point(902, 324); @@ -243,5 +268,8 @@ private ToolStripMenuItem магазиныToolStripMenuItem; private ToolStripMenuItem пополнениеМагазинаToolStripMenuItem; private Button buttonSell; + private ToolStripMenuItem ShopsToolStripMenuItem; + private ToolStripMenuItem ShopsFurnituresToolStripMenuItem; + private ToolStripMenuItem OrderDateToolStripMenuItem; } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.cs index e71077b..eee9fe1 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.cs @@ -220,5 +220,19 @@ namespace FurnitureAssembly form.ShowDialog(); } } + + private void ShopsToolStripMenuItem_Click_1(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveShopsToWordFile(new ReportBindingModel + { + FileName = dialog.FileName + }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + } } } -- 2.25.1 From ca519fe8c8e2f4509687a26dd1f909124949aebf Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Sun, 26 Mar 2023 08:49:42 +0400 Subject: [PATCH 02/23] =?UTF-8?q?=D0=A1=D0=BF=D0=B8=D1=81=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=B2=20=D0=B2?= =?UTF-8?q?=20Word?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToWord.cs | 26 +++++- .../OfficePackage/HelperModels/WordInfo.cs | 1 + .../OfficePackage/HelperModels/WordTable.cs | 12 +++ .../OfficePackage/Implements/SaveToWord.cs | 82 +++++++++++++++++++ .../ReportLogic.cs | 19 ++++- .../BusinessLogicsContarcts/IReportLogic.cs | 1 + 6 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordTable.cs diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs index f4f1705..663713d 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -1,4 +1,5 @@ -using FurnitureAssemblyBusinessLogic.OfficePackage.HelperEnums; +using DocumentFormat.OpenXml.EMMA; +using FurnitureAssemblyBusinessLogic.OfficePackage.HelperEnums; using FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels; @@ -6,6 +7,28 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage { public abstract class AbstractSaveToWord { + public void CreateTableDoc(WordInfo wordInfo) { + CreateWord(wordInfo); + var list = new List(); + foreach (var shop in wordInfo.Shops) { + list.Add(shop.ShopName); + list.Add(shop.Address); + list.Add(shop.DateOpening.ToString()); + } + //list.AddRange(wordInfo.Shops.Select(x => (x.ShopName, new WordTextProperties { Bold = true, Size = "24" }))); + var wordTable = new WordTable + { + Headers = new List { + "Название", + "Адрес", + "Дата открытия"}, + Texts = list + }; + CreateTable(wordTable); + + SaveWord(wordInfo); + + } public void CreateDoc(WordInfo info) { CreateWord(info); @@ -38,6 +61,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage /// /// protected abstract void CreateWord(WordInfo info); + protected abstract void CreateTable(WordTable info); /// /// Создание абзаца с текстом /// diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index 73ebd4d..16bfb63 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -7,5 +7,6 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; public List Furnitures { get; set; } = new(); + public List Shops { get; set; } = new(); } } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordTable.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordTable.cs new file mode 100644 index 0000000..d5f0c1a --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordTable.cs @@ -0,0 +1,12 @@ + + +using FurnitureAssemblyContracts.ViewModels; + +namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels +{ + public class WordTable + { + public List Headers { get; set; } = new(); + public List Texts { get; set; } = new (); + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 51af240..6ad4043 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -3,6 +3,7 @@ using FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels; using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Wordprocessing; +using System.Xml.Linq; namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements { @@ -122,5 +123,86 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements _wordDocument.MainDocumentPart!.Document.Save(); _wordDocument.Close(); } + + protected override void CreateTable(WordTable table) + { + if (_docBody == null || table == null) + { + return; + } + Table tab = new Table(); + TableProperties props = new TableProperties( + new TableBorders( + new TopBorder + { + Val = new EnumValue(BorderValues.Single), + Size = 12 + }, + new BottomBorder + { + Val = new EnumValue(BorderValues.Single), + Size = 12 + }, + new LeftBorder + { + Val = new EnumValue(BorderValues.Single), + Size = 12 + }, + new RightBorder + { + Val = new EnumValue(BorderValues.Single), + Size = 12 + }, + new InsideHorizontalBorder + { + Val = new EnumValue(BorderValues.Single), + Size = 12 + }, + new InsideVerticalBorder + { + Val = new EnumValue(BorderValues.Single), + Size = 12 + } + ) + ); + tab.AppendChild(props); + // разметка сетки таблицы + TableGrid tableGrid = new TableGrid(); + for (int i = 0; i < table.Headers.Count; i++) { + tableGrid.AppendChild(new GridColumn ()); + } + tab.AppendChild(tableGrid); + TableRow tableRow = new TableRow(); + // заполнение заголовков + foreach (var text in table.Headers) + { + tableRow.AppendChild(CreateTableCell(text)); + } + tab.AppendChild(tableRow); + // заполнение содержимым + int height = table.Texts.Count / table.Headers.Count; + int width = table.Headers.Count; + for (int i = 0; i < height; i++) { + tableRow = new TableRow(); + for (int j = 0; j < width; j++) { + var element = table.Texts[i * table.Headers.Count + j]; + tableRow.AppendChild(CreateTableCell(element)); + } + tab.AppendChild(tableRow); + } + + _docBody.AppendChild(tab); + + } + + private TableCell CreateTableCell(string element) { + var tableParagraph = new Paragraph(); + var run = new Run(); + run.AppendChild(new Text { Text = element }); + tableParagraph.AppendChild(run); + var tableCell = new TableCell(); + tableCell.AppendChild(tableParagraph); + return tableCell; + } } } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs index a995780..b93f9a6 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs @@ -17,17 +17,19 @@ namespace FurnitureAssemblyBusinessLogic { private readonly IFurnitureStorage _furnitureStorage; private readonly IOrderStorage _orderStorage; + private readonly IShopStorage _shopStorage; private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToWord _saveToWord; private readonly AbstractSaveToPdf _saveToPdf; public ReportLogic(IFurnitureStorage furnitureStorage, IOrderStorage orderStorage, - AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) + AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf, IShopStorage shopStorage) { _furnitureStorage = furnitureStorage; _orderStorage = orderStorage; _saveToExcel = saveToExcel; _saveToWord = saveToWord; _saveToPdf = saveToPdf; + _shopStorage = shopStorage; } /// /// Получение списка компонент с указанием, в каких изделиях используются @@ -88,7 +90,7 @@ namespace FurnitureAssemblyBusinessLogic Title = "Список изделий", Furnitures = _furnitureStorage.GetFullList() }); - } + } /// /// Сохранение компонент с указаеним продуктов в файл-Excel /// @@ -117,5 +119,18 @@ namespace FurnitureAssemblyBusinessLogic Orders = GetOrders(model) }); } + /// + /// Сохранение магазинов в файл-Word + /// + /// + public void SaveShopsToWordFile(ReportBindingModel model) + { + _saveToWord.CreateTableDoc(new WordInfo + { + FileName = model.FileName, + Title = "Список магазинов", + Shops = _shopStorage.GetFullList() + }); + } } } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs index 45ec909..eff1f58 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs @@ -31,5 +31,6 @@ namespace FurnitureAssemblyContracts.BusinessLogicsContarcts /// /// void SaveOrdersToPdfFile(ReportBindingModel model); + void SaveShopsToWordFile(ReportBindingModel model); } } -- 2.25.1 From fe89fc9399ec693fcd331cdd33868e6254c334b3 Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Sun, 26 Mar 2023 09:42:14 +0400 Subject: [PATCH 03/23] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=B0=20Word?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToWord.cs | 72 ++++++++++++------- .../OfficePackage/HelperModels/WordInfo.cs | 4 +- .../HelperModels/WordInfoFurnitures.cs | 14 ++++ .../HelperModels/WordInfoShops.cs | 14 ++++ .../OfficePackage/Implements/SaveToWord.cs | 2 +- 5 files changed, 78 insertions(+), 28 deletions(-) create mode 100644 FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoFurnitures.cs create mode 100644 FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoShops.cs diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 663713d..557dce7 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -9,26 +9,46 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage { public void CreateTableDoc(WordInfo wordInfo) { CreateWord(wordInfo); - var list = new List(); - foreach (var shop in wordInfo.Shops) { - list.Add(shop.ShopName); - list.Add(shop.Address); - list.Add(shop.DateOpening.ToString()); - } - //list.AddRange(wordInfo.Shops.Select(x => (x.ShopName, new WordTextProperties { Bold = true, Size = "24" }))); - var wordTable = new WordTable + CreateParagraph(new WordParagraph { - Headers = new List { - "Название", - "Адрес", - "Дата открытия"}, - Texts = list - }; + Texts = new List<(string, WordTextProperties)> { (wordInfo.Title, new WordTextProperties { Bold = true, Size = "24", }) }, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Center + } + }); + WordTable wordTable = new(); + if (wordInfo is WordInfoShops infoShops) + { + wordTable = CreateTableDocShops(infoShops); + } CreateTable(wordTable); SaveWord(wordInfo); } + private WordTable CreateTableDocShops(WordInfoShops wordInfo) + { + var list = new List(); + foreach (var shop in wordInfo.Shops) + { + list.Add(shop.ShopName); + list.Add(shop.Address); + list.Add(shop.DateOpening.ToString()); + } + + var wordTable = new WordTable + { + Headers = new List { + "Название", + "Адрес", + "Дата открытия"}, + Texts = list + }; + return wordTable; + } + public void CreateDoc(WordInfo info) { CreateWord(info); @@ -41,18 +61,22 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage JustificationType = WordJustificationType.Center } }); - foreach (var furniture in info.Furnitures) - { - CreateParagraph(new WordParagraph - { - Texts = new List<(string, WordTextProperties)> { (furniture.FurnitureName, new WordTextProperties { Size = "24", Bold=true}), (" - " + furniture.Price.ToString(), new WordTextProperties { Size = "24", }) }, - TextProperties = new WordTextProperties + if (info is WordInfoFurnitures infoFurnitures) { + foreach (var furniture in infoFurnitures.Furnitures) { - Size = "24", - JustificationType = WordJustificationType.Both - } - }); + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { (furniture.FurnitureName, + new WordTextProperties { Size = "24", Bold=true}), (" - " + furniture.Price.ToString(), + new WordTextProperties { Size = "24", }) }, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Both + } + }); + } } SaveWord(info); } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index 16bfb63..828646f 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -5,8 +5,6 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels public class WordInfo { public string FileName { get; set; } = string.Empty; - public string Title { get; set; } = string.Empty; - public List Furnitures { get; set; } = new(); - public List Shops { get; set; } = new(); + public string Title { get; set; } = string.Empty; } } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoFurnitures.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoFurnitures.cs new file mode 100644 index 0000000..7866136 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoFurnitures.cs @@ -0,0 +1,14 @@ +using FurnitureAssemblyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels +{ + public class WordInfoFurnitures : WordInfo + { + public List Furnitures { get; set; } = new(); + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoShops.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoShops.cs new file mode 100644 index 0000000..9deb087 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/WordInfoShops.cs @@ -0,0 +1,14 @@ +using FurnitureAssemblyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels +{ + public class WordInfoShops : WordInfo + { + public List Shops { get; set; } = new(); + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 6ad4043..7b08741 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -196,7 +196,7 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.Implements } private TableCell CreateTableCell(string element) { - var tableParagraph = new Paragraph(); + var tableParagraph = new Paragraph(); var run = new Run(); run.AppendChild(new Text { Text = element }); tableParagraph.AppendChild(run); -- 2.25.1 From 3c02e6902a7e80d067d316d264bcb1c69527fe8c Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Sun, 26 Mar 2023 09:42:55 +0400 Subject: [PATCH 04/23] =?UTF-8?q?Excel:=20=D1=81=D0=BF=D0=B8=D1=81=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=20=D1=81=20=D0=B8=D0=B7=D0=B4=D0=B5=D0=BB=D0=B8=D1=8F=D0=BC?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FurnitureAssembly/FormMain.Designer.cs | 1 + .../FurnitureAssembly/FormMain.cs | 9 ++ .../FormReportShopFurnitures.Designer.cs | 104 ++++++++++++++++ .../FormReportShopFurnitures.cs | 87 ++++++++++++++ .../FormReportShopFurnitures.resx | 78 ++++++++++++ .../FurnitureAssembly/Program.cs | 1 + .../OfficePackage/AbstractSaveToExcel.cs | 113 +++++++++++++++++- .../OfficePackage/HelperModels/ExcelInfo.cs | 7 +- .../HelperModels/ExcelInfoFurnitures.cs | 18 +++ .../HelperModels/ExcelInfoShops.cs | 18 +++ .../ReportLogic.cs | 38 +++++- .../BusinessLogicsContarcts/IReportLogic.cs | 3 + .../ReportShopFurnituresViewModel.cs | 15 +++ 13 files changed, 481 insertions(+), 11 deletions(-) create mode 100644 FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.Designer.cs create mode 100644 FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.cs create mode 100644 FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.resx create mode 100644 FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoFurnitures.cs create mode 100644 FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoShops.cs create mode 100644 FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportShopFurnituresViewModel.cs diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs index f841985..849bbff 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs @@ -207,6 +207,7 @@ this.ShopsFurnituresToolStripMenuItem.Name = "ShopsFurnituresToolStripMenuItem"; this.ShopsFurnituresToolStripMenuItem.Size = new System.Drawing.Size(216, 22); this.ShopsFurnituresToolStripMenuItem.Text = "Изделия в магазинах"; + this.ShopsFurnituresToolStripMenuItem.Click += new System.EventHandler(this.ShopsFurnituresToolStripMenuItem_Click); // // OrderDateToolStripMenuItem // diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.cs index eee9fe1..14d6c1d 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.cs @@ -234,5 +234,14 @@ namespace FurnitureAssembly MessageBoxIcon.Information); } } + + private void ShopsFurnituresToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportShopFurnitures)); + if (service is FormReportShopFurnitures form) + { + form.ShowDialog(); + } + } } } diff --git a/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.Designer.cs b/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.Designer.cs new file mode 100644 index 0000000..c07d679 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.Designer.cs @@ -0,0 +1,104 @@ +namespace FurnitureAssembly +{ + partial class FormReportShopFurnitures + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.ButtonSaveToExcel = new System.Windows.Forms.Button(); + this.dataGridView = new System.Windows.Forms.DataGridView(); + this.Shop = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Furniture = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Count = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); + this.SuspendLayout(); + // + // ButtonSaveToExcel + // + this.ButtonSaveToExcel.Location = new System.Drawing.Point(12, 22); + this.ButtonSaveToExcel.Name = "ButtonSaveToExcel"; + this.ButtonSaveToExcel.Size = new System.Drawing.Size(166, 27); + this.ButtonSaveToExcel.TabIndex = 1; + this.ButtonSaveToExcel.Text = "Сохранить в Excel"; + this.ButtonSaveToExcel.UseVisualStyleBackColor = true; + this.ButtonSaveToExcel.Click += new System.EventHandler(this.ButtonSaveToExcel_Click); + // + // dataGridView + // + this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Shop, + this.Furniture, + this.Count}); + this.dataGridView.Location = new System.Drawing.Point(12, 80); + this.dataGridView.Name = "dataGridView"; + this.dataGridView.RowTemplate.Height = 25; + this.dataGridView.Size = new System.Drawing.Size(600, 358); + this.dataGridView.TabIndex = 2; + // + // Shop + // + this.Shop.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Shop.HeaderText = "Магазин"; + this.Shop.Name = "Shop"; + // + // Furniture + // + this.Furniture.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Furniture.HeaderText = "Изделие"; + this.Furniture.Name = "Furniture"; + // + // Count + // + this.Count.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + this.Count.HeaderText = "Количество"; + this.Count.Name = "Count"; + this.Count.Width = 97; + // + // FormReportShopFurnitures + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(627, 450); + this.Controls.Add(this.dataGridView); + this.Controls.Add(this.ButtonSaveToExcel); + this.Name = "FormReportShopFurnitures"; + this.Text = "Магазины с изделиями"; + this.Load += new System.EventHandler(this.FormReportShopFurnitures_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private Button ButtonSaveToExcel; + private DataGridView dataGridView; + private DataGridViewTextBoxColumn Shop; + private DataGridViewTextBoxColumn Furniture; + private DataGridViewTextBoxColumn Count; + } +} \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.cs b/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.cs new file mode 100644 index 0000000..e4b3d87 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.cs @@ -0,0 +1,87 @@ +using FurnitureAssemblyContracts.BindingModels; +using FurnitureAssemblyContracts.BusinessLogicsContarcts; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FurnitureAssembly +{ + public partial class FormReportShopFurnitures : Form + { + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportShopFurnitures(ILogger logger, IReportLogic reportLogic) + { + InitializeComponent(); + _logger = logger; + _logic = reportLogic; + } + + private void ButtonSaveToExcel_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog + { + Filter = "xlsx|*.xlsx" + }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveShopFurnituresToExcelFile(new + ReportBindingModel + { + FileName = dialog.FileName + }); + _logger.LogInformation("Сохранение списка магазинов с изделиями в них"); + + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, + MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка магазинов с изделиями в них"); + + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } + } + + private void FormReportShopFurnitures_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetShopFurnitures(); + if (dict != null) + { + dataGridView.Rows.Clear(); + foreach (var elem in dict) + { + dataGridView.Rows.Add(new object[] { elem.ShopName, "", "" }); + foreach (var listElem in elem.Furnitures) + { + dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); + } + dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount }); + dataGridView.Rows.Add(Array.Empty()); + } + } + _logger.LogInformation("Загрузка списка магазинов с изделиями в них"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка магазинов с изделиями в них"); + + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, + MessageBoxIcon.Error); + } + } + } +} diff --git a/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.resx b/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.resx new file mode 100644 index 0000000..7f75b9f --- /dev/null +++ b/FurnitureAssembly/FurnitureAssembly/FormReportShopFurnitures.resx @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssembly/Program.cs b/FurnitureAssembly/FurnitureAssembly/Program.cs index 520c635..7044ee0 100644 --- a/FurnitureAssembly/FurnitureAssembly/Program.cs +++ b/FurnitureAssembly/FurnitureAssembly/Program.cs @@ -64,6 +64,7 @@ namespace FurnitureAssembly services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 4e1cdf3..0acd7c9 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -1,4 +1,5 @@ -using FurnitureAssemblyBusinessLogic.OfficePackage.HelperEnums; +using DocumentFormat.OpenXml.EMMA; +using FurnitureAssemblyBusinessLogic.OfficePackage.HelperEnums; using FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels; using System; using System.Collections.Generic; @@ -30,6 +31,64 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage CellToName = "C1" }); uint rowIndex = 2; + if (info is ExcelInfoFurnitures infoFurnitures) + { + CreateExcelCellsFurnitures(infoFurnitures, rowIndex); + } + else if (info is ExcelInfoShops infoShops) + { + CreateExcelCellsShops(infoShops, rowIndex); + } + /* foreach (var pc in info.FurnitureComponents) + { + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "A", + RowIndex = rowIndex, + Text = pc.FurnitureName, + StyleInfo = ExcelStyleInfoType.Text + }); + rowIndex++; + foreach (var product in pc.Components) + { + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "B", + RowIndex = rowIndex, + Text = product.Item1, + StyleInfo = + ExcelStyleInfoType.TextWithBroder + }); + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "C", + RowIndex = rowIndex, + Text = product.Item2.ToString(), + StyleInfo = + ExcelStyleInfoType.TextWithBroder + }); + rowIndex++; + } + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "A", + RowIndex = rowIndex, + Text = "Итого", + StyleInfo = ExcelStyleInfoType.Text + }); + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "C", + RowIndex = rowIndex, + Text = pc.TotalCount.ToString(), + StyleInfo = ExcelStyleInfoType.Text + }); + rowIndex++; + }*/ + SaveExcel(info); + } + private void CreateExcelCellsFurnitures(ExcelInfoFurnitures info, uint rowIndex) + { foreach (var pc in info.FurnitureComponents) { InsertCellInWorksheet(new ExcelCellParameters @@ -76,8 +135,58 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage }); rowIndex++; } - SaveExcel(info); } + + private void CreateExcelCellsShops(ExcelInfoShops info, uint rowIndex) + { + foreach (var sF in info.ShopFurnitures) + { + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "A", + RowIndex = rowIndex, + Text = sF.ShopName, + StyleInfo = ExcelStyleInfoType.Text + }); + rowIndex++; + foreach (var furniture in sF.Furnitures) + { + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "B", + RowIndex = rowIndex, + Text = furniture.Item1, + StyleInfo = + ExcelStyleInfoType.TextWithBroder + }); + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "C", + RowIndex = rowIndex, + Text = furniture.Item2.ToString(), + StyleInfo = + ExcelStyleInfoType.TextWithBroder + }); + rowIndex++; + } + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "A", + RowIndex = rowIndex, + Text = "Итого", + StyleInfo = ExcelStyleInfoType.Text + }); + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "C", + RowIndex = rowIndex, + Text = sF.TotalCount.ToString(), + StyleInfo = ExcelStyleInfoType.Text + }); + rowIndex++; + } + } + /// /// Создание excel-файла /// diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs index 8ba52a0..668f5cd 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs @@ -5,11 +5,6 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels public class ExcelInfo { public string FileName { get; set; } = string.Empty; - public string Title { get; set; } = string.Empty; - public List FurnitureComponents - { - get; - set; - } = new(); + public string Title { get; set; } = string.Empty; } } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoFurnitures.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoFurnitures.cs new file mode 100644 index 0000000..697b1db --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoFurnitures.cs @@ -0,0 +1,18 @@ +using FurnitureAssemblyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels +{ + public class ExcelInfoFurnitures : ExcelInfo + { + public List FurnitureComponents + { + get; + set; + } = new(); + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoShops.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoShops.cs new file mode 100644 index 0000000..d3f0dd0 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/ExcelInfoShops.cs @@ -0,0 +1,18 @@ +using FurnitureAssemblyContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureAssemblyBusinessLogic.OfficePackage.HelperModels +{ + public class ExcelInfoShops : ExcelInfo + { + public List ShopFurnitures + { + get; + set; + } = new(); + } +} diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs index b93f9a6..9f11769 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs @@ -84,7 +84,7 @@ namespace FurnitureAssemblyBusinessLogic /// public void SaveFurnituresToWordFile(ReportBindingModel model) { - _saveToWord.CreateDoc(new WordInfo + _saveToWord.CreateDoc(new WordInfoFurnitures { FileName = model.FileName, Title = "Список изделий", @@ -97,7 +97,7 @@ namespace FurnitureAssemblyBusinessLogic /// public void SaveFurnitureComponentToExcelFile(ReportBindingModel model) { - _saveToExcel.CreateReport(new ExcelInfo + _saveToExcel.CreateReport(new ExcelInfoFurnitures { FileName = model.FileName, Title = "Список изделий", @@ -125,12 +125,44 @@ namespace FurnitureAssemblyBusinessLogic /// public void SaveShopsToWordFile(ReportBindingModel model) { - _saveToWord.CreateTableDoc(new WordInfo + _saveToWord.CreateTableDoc(new WordInfoShops { FileName = model.FileName, Title = "Список магазинов", Shops = _shopStorage.GetFullList() }); } + + public void SaveShopFurnituresToExcelFile(ReportBindingModel model) + { + _saveToExcel.CreateReport(new ExcelInfoShops + { + FileName = model.FileName, + Title = "Список магазинов с изделиями", + ShopFurnitures = GetShopFurnitures() + }); + } + + public List GetShopFurnitures() + { + var shops = _shopStorage.GetFullList(); + var list = new List(); + foreach (var shop in shops) + { + var record = new ReportShopFurnituresViewModel + { + ShopName = shop.ShopName, + Furnitures = new List>(), + TotalCount = 0 + }; + foreach (var furnitureCount in shop.Furnitures.Values) + { + record.Furnitures.Add(new Tuple(furnitureCount.Item1.FurnitureName, furnitureCount.Item2)); + record.TotalCount += furnitureCount.Item2; + } + list.Add(record); + } + return list; + } } } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs index eff1f58..d3b108f 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/BusinessLogicsContarcts/IReportLogic.cs @@ -32,5 +32,8 @@ namespace FurnitureAssemblyContracts.BusinessLogicsContarcts /// void SaveOrdersToPdfFile(ReportBindingModel model); void SaveShopsToWordFile(ReportBindingModel model); + void SaveShopFurnituresToExcelFile(ReportBindingModel model); + + List GetShopFurnitures(); } } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportShopFurnituresViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportShopFurnituresViewModel.cs new file mode 100644 index 0000000..079b791 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportShopFurnituresViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace FurnitureAssemblyContracts.ViewModels +{ + public class ReportShopFurnituresViewModel + { + public string ShopName { get; set; } = string.Empty; + public int TotalCount { get; set; } + public List> Furnitures { get; set; } = new(); + } +} -- 2.25.1 From 7b727b6b8fef248e266bf1a779133b373d949c9f Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Wed, 1 Mar 2023 15:55:49 +0400 Subject: [PATCH 05/23] =?UTF-8?q?Pdf:=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=B4?= =?UTF-8?q?=D0=B8=D0=BD=D0=B5=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=B7=D0=B0=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D1=8B=20=D0=B2=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=20=D0=B8=20=D0=BD=D0=B0=20=D1=84=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FurnitureAssembly/FormMain.Designer.cs | 1 + .../FurnitureAssembly/FormMain.cs | 9 + .../FormReportCountOrdersByPeriod.Designer.cs | 167 +++++++ .../FormReportCountOrdersByPeriod.cs | 100 ++++ .../FormReportCountOrdersByPeriod.resx | 60 +++ .../FurnitureAssembly.csproj | 4 + .../FurnitureAssembly/Program.cs | 1 + .../FurnitureAssembly/ReportOrdersCount.rdlc | 459 ++++++++++++++++++ .../OfficePackage/AbstractSaveToPdf.cs | 66 ++- .../OfficePackage/HelperModels/PdfInfo.cs | 1 - .../HelperModels/PdfInfoCountOrders.cs | 14 + .../HelperModels/PdfInfoOrders.cs | 14 + .../ReportLogic.cs | 23 +- .../BusinessLogicsContarcts/IReportLogic.cs | 8 +- .../ViewModels/ReportCountOrdersViewModel.cs | 15 + 15 files changed, 937 insertions(+), 5 deletions(-) create mode 100644 FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.Designer.cs create mode 100644 FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.cs create mode 100644 FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.resx create mode 100644 FurnitureAssembly/FurnitureAssembly/ReportOrdersCount.rdlc create mode 100644 FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/PdfInfoCountOrders.cs create mode 100644 FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/HelperModels/PdfInfoOrders.cs create mode 100644 FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportCountOrdersViewModel.cs diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs index 849bbff..25c1e5c 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.Designer.cs @@ -214,6 +214,7 @@ this.OrderDateToolStripMenuItem.Name = "OrderDateToolStripMenuItem"; this.OrderDateToolStripMenuItem.Size = new System.Drawing.Size(216, 22); this.OrderDateToolStripMenuItem.Text = "Список заказов по датам"; + this.OrderDateToolStripMenuItem.Click += new System.EventHandler(this.OrderDateToolStripMenuItem_Click); // // buttonSell // diff --git a/FurnitureAssembly/FurnitureAssembly/FormMain.cs b/FurnitureAssembly/FurnitureAssembly/FormMain.cs index 14d6c1d..aff2407 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormMain.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormMain.cs @@ -243,5 +243,14 @@ namespace FurnitureAssembly form.ShowDialog(); } } + + private void OrderDateToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportCountOrdersByPeriod)); + if (service is FormReportCountOrdersByPeriod form) + { + form.ShowDialog(); + } + } } } diff --git a/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.Designer.cs b/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.Designer.cs new file mode 100644 index 0000000..cf6cc18 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.Designer.cs @@ -0,0 +1,167 @@ +namespace FurnitureAssembly +{ + partial class FormReportCountOrdersByPeriod + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.panel = new System.Windows.Forms.Panel(); + this.buttonMake_Pdf = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.buttonToPdf = new System.Windows.Forms.Button(); + this.buttonMake = new System.Windows.Forms.Button(); + this.dateTimePickerTo = new System.Windows.Forms.DateTimePicker(); + this.labelTo = new System.Windows.Forms.Label(); + this.dateTimePickerFrom = new System.Windows.Forms.DateTimePicker(); + this.labelFrom = new System.Windows.Forms.Label(); + this.panel.SuspendLayout(); + this.SuspendLayout(); + // + // panel + // + this.panel.Controls.Add(this.buttonMake_Pdf); + this.panel.Controls.Add(this.button1); + this.panel.Controls.Add(this.buttonToPdf); + this.panel.Controls.Add(this.buttonMake); + this.panel.Controls.Add(this.dateTimePickerTo); + this.panel.Controls.Add(this.labelTo); + this.panel.Controls.Add(this.dateTimePickerFrom); + this.panel.Controls.Add(this.labelFrom); + this.panel.Dock = System.Windows.Forms.DockStyle.Top; + this.panel.Location = new System.Drawing.Point(0, 0); + this.panel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.panel.Name = "panel"; + this.panel.Size = new System.Drawing.Size(987, 40); + this.panel.TabIndex = 2; + // + // buttonMake_Pdf + // + this.buttonMake_Pdf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonMake_Pdf.Location = new System.Drawing.Point(826, 8); + this.buttonMake_Pdf.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.buttonMake_Pdf.Name = "buttonMake_Pdf"; + this.buttonMake_Pdf.Size = new System.Drawing.Size(139, 27); + this.buttonMake_Pdf.TabIndex = 7; + this.buttonMake_Pdf.Text = "В Pdf"; + this.buttonMake_Pdf.UseVisualStyleBackColor = true; + this.buttonMake_Pdf.Click += new System.EventHandler(this.ButtonToPdf_Click); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(1564, 8); + this.button1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(139, 27); + this.button1.TabIndex = 6; + this.button1.Text = "В Pdf"; + this.button1.UseVisualStyleBackColor = true; + // + // buttonToPdf + // + this.buttonToPdf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonToPdf.Location = new System.Drawing.Point(2452, 8); + this.buttonToPdf.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.buttonToPdf.Name = "buttonToPdf"; + this.buttonToPdf.Size = new System.Drawing.Size(139, 27); + this.buttonToPdf.TabIndex = 5; + this.buttonToPdf.Text = "В Pdf"; + this.buttonToPdf.UseVisualStyleBackColor = true; + // + // buttonMake + // + this.buttonMake.Location = new System.Drawing.Point(476, 8); + this.buttonMake.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.buttonMake.Name = "buttonMake"; + this.buttonMake.Size = new System.Drawing.Size(139, 27); + this.buttonMake.TabIndex = 4; + this.buttonMake.Text = "Сформировать"; + this.buttonMake.UseVisualStyleBackColor = true; + this.buttonMake.Click += new System.EventHandler(this.buttonMake_Click); + // + // dateTimePickerTo + // + this.dateTimePickerTo.Location = new System.Drawing.Point(237, 7); + this.dateTimePickerTo.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.dateTimePickerTo.Name = "dateTimePickerTo"; + this.dateTimePickerTo.Size = new System.Drawing.Size(163, 23); + this.dateTimePickerTo.TabIndex = 3; + // + // labelTo + // + this.labelTo.AutoSize = true; + this.labelTo.Location = new System.Drawing.Point(208, 10); + this.labelTo.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.labelTo.Name = "labelTo"; + this.labelTo.Size = new System.Drawing.Size(21, 15); + this.labelTo.TabIndex = 2; + this.labelTo.Text = "по"; + // + // dateTimePickerFrom + // + this.dateTimePickerFrom.Location = new System.Drawing.Point(37, 7); + this.dateTimePickerFrom.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.dateTimePickerFrom.Name = "dateTimePickerFrom"; + this.dateTimePickerFrom.Size = new System.Drawing.Size(163, 23); + this.dateTimePickerFrom.TabIndex = 1; + // + // labelFrom + // + this.labelFrom.AutoSize = true; + this.labelFrom.Location = new System.Drawing.Point(14, 10); + this.labelFrom.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.labelFrom.Name = "labelFrom"; + this.labelFrom.Size = new System.Drawing.Size(15, 15); + this.labelFrom.TabIndex = 0; + this.labelFrom.Text = "С"; + // + // FormReportCountOrdersByPeriod + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(987, 596); + this.Controls.Add(this.panel); + this.Name = "FormReportCountOrdersByPeriod"; + this.Text = "Заказы по датам"; + this.panel.ResumeLayout(false); + this.panel.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private Panel panel; + private Button button1; + private Button buttonToPdf; + private Button buttonMake; + private DateTimePicker dateTimePickerTo; + private Label labelTo; + private DateTimePicker dateTimePickerFrom; + private Label labelFrom; + private Button buttonMake_Pdf; + } +} \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.cs b/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.cs new file mode 100644 index 0000000..b432798 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.cs @@ -0,0 +1,100 @@ +using FurnitureAssemblyContracts.BindingModels; +using FurnitureAssemblyContracts.BusinessLogicsContarcts; +using Microsoft.Extensions.Logging; +using Microsoft.Reporting.WinForms; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace FurnitureAssembly +{ + public partial class FormReportCountOrdersByPeriod : Form + { + private readonly ReportViewer reportViewer; + + private readonly ILogger _logger; + + private readonly IReportLogic _logic; + + public FormReportCountOrdersByPeriod(ILogger logger, IReportLogic reportLogic) + { + InitializeComponent(); + _logger = logger; + _logic = reportLogic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrdersCount.rdlc", FileMode.Open)); // другой файл + Controls.Clear(); + Controls.Add(reportViewer); + Controls.Add(panel); + } + + private void buttonMake_Click(object sender, EventArgs e) + { + if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date) + { + MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + try + { + var dataSource = _logic.GetCountOrders(new ReportBindingModel + { + DateFrom = dateTimePickerFrom.Value, + DateTo = dateTimePickerTo.Value + }); + var source = new ReportDataSource("DataSetOrders", dataSource); + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + var parameters = new[] { new ReportParameter("ReportParameterPeriod", + $"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") }; + reportViewer.LocalReport.SetParameters(parameters); + + reportViewer.RefreshReport(); + _logger.LogInformation("Загрузка списка заказов на период {From}-{To}", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString()); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка заказов на период"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonToPdf_Click(object sender, EventArgs e) + { + if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date) + { + MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveCountOrdersToPdfFile(new ReportBindingModel + { + FileName = dialog.FileName, + DateFrom = dateTimePickerFrom.Value, + DateTo = dateTimePickerTo.Value + }); + _logger.LogInformation("Сохранение списка заказов на период {From}-{To}", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString()); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка заказов на период"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } +} diff --git a/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.resx b/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/FurnitureAssembly/FurnitureAssembly/FormReportCountOrdersByPeriod.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssembly/FurnitureAssembly.csproj b/FurnitureAssembly/FurnitureAssembly/FurnitureAssembly.csproj index 7eb04fa..71f961d 100644 --- a/FurnitureAssembly/FurnitureAssembly/FurnitureAssembly.csproj +++ b/FurnitureAssembly/FurnitureAssembly/FurnitureAssembly.csproj @@ -11,6 +11,7 @@ + @@ -20,6 +21,9 @@ Always + + Always + diff --git a/FurnitureAssembly/FurnitureAssembly/Program.cs b/FurnitureAssembly/FurnitureAssembly/Program.cs index 7044ee0..8382cfb 100644 --- a/FurnitureAssembly/FurnitureAssembly/Program.cs +++ b/FurnitureAssembly/FurnitureAssembly/Program.cs @@ -65,6 +65,7 @@ namespace FurnitureAssembly services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file diff --git a/FurnitureAssembly/FurnitureAssembly/ReportOrdersCount.rdlc b/FurnitureAssembly/FurnitureAssembly/ReportOrdersCount.rdlc new file mode 100644 index 0000000..73d8265 --- /dev/null +++ b/FurnitureAssembly/FurnitureAssembly/ReportOrdersCount.rdlc @@ -0,0 +1,459 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 10791c83-cee8-4a38-bbd0-245fc17cefb3 + + + + + + FurnitureAssemblyContractsViewModels + /* Local Query */ + + + + DateCreate + System.DateTime + + + CountOrders + System.Decimal + + + TotalSumOrders + System.Double + + + + FurnitureAssemblyContracts.ViewModels + ReportCountOrdersViewModel + FurnitureAssemblyContracts.ViewModels.ReportCountOrdersViewModel, FurnitureAssemblyContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + + + + + true + true + + + + + =Parameters!ReportParameterPeriod.Value + + + + + + + ReportParameterPeriod + 1cm + 1cm + 21cm + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Заказы + + + + + + + 1cm + 21cm + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + 3cm + + + 3cm + + + 7cm + + + + + 0.6cm + + + + + true + true + + + + + Дата создания + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Количество заказов + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Сумма + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!DateCreate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!CountOrders.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!TotalSumOrders.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSetOrders + 2.48391cm + 0.55245cm + 1.2cm + 19.84713cm + 2 + + + + + + true + true + + + + + Итого: + + + + + + + 4cm + 15.39958cm + 0.6cm + 2.5cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!TotalSumOrders.Value, "DataSetOrders") + + + + + + + 4cm + 17.89958cm + 0.6cm + 2.5cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + 5.72875cm + + + + + + + ReportParameterPeriod + 1cm + 1cm + 21cm + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Заказы + + + + + + + 1cm + 21cm + 1 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + 2.5cm + + + 3.21438cm + + + 8.23317cm + + + 3.02917cm + + + 2.87042cm + + + + + 0.6cm + + + + + true + true + + + + + Номер + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Дата создания + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Изделие + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Статус заказа + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Сумма + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Id.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DateCreate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!FurnitureName.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!OrderStatus.Value + + + 2pt + 2pt + 2pt + 2pt + + + true + + + + + + true + true + + + + + =Fields!Sum.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSetOrders + 2.48391cm + 0.55245cm + 1.2cm + 19.84713cm + 2 + + + + + + true + true + + + + + Итого: + + + + + + + 4cm + 15.39958cm + 0.6cm + 2.5cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!Sum.Value, "DataSetOrders") + + + + + + + 4cm + 17.89958cm + 0.6cm + 2.5cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + 5.72875cm +