{"id":456138,"date":"2025-04-15T09:01:33","date_gmt":"2025-04-15T09:01:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=456138"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=456138","title":{"rendered":"<span>\u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0447\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 .NET \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e OpenXml. \u0427\u0430\u0441\u0442\u044c 2<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0420\u043e\u0434\u043e\u0432, \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0411\u0410\u0420\u0421 \u0413\u0440\u0443\u043f\u00bb, \u0430\u0432\u0442\u043e\u0440 \u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0447\u0430\u0442\u043d\u044b\u0445 \u0444\u043e\u0440\u043c Sprinter. \u042d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a DocumentFormat.OpenXml \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0447\u0430\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u00ab\u043e\u0444\u0438\u0441\u043d\u044b\u0445\u00bb \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0432 <a href=\"https:\/\/habr.com\/ru\/companies\/barsgroup\/articles\/893810\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u043c\u044b \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043d\u0430\u0448\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0435\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435. \u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0448\u0430\u043f\u043a\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u043a\u043e\u043b\u043e\u043d\u0442\u0438\u0442\u0443\u043b \u0441 \u043b\u043e\u0433\u043e\u0442\u0438\u043f\u043e\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0432\u044b\u0448\u0435. \u041d\u0443 \u0430 \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0443 \u043d\u0430\u0441 \u2014 \u043f\u0435\u0447\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 docx!<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cf9\/964\/f51\/cf9964f51dd6af4d3e92ff779acd9f07.jpg\" width=\"619\" height=\"924\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/cf9\/964\/f51\/cf9964f51dd6af4d3e92ff779acd9f07.jpg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cf9\/964\/f51\/cf9964f51dd6af4d3e92ff779acd9f07.jpg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h3>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 docx \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 OpenXml. \u041e\u0431\u044a\u0435\u043a\u0442 TableProperties \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446 \u0438 \u043c\u0430\u043a\u0435\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442 TableGrid \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0414\u043b\u044f \u0433\u0440\u0430\u043d\u0438\u0446 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0446\u0432\u0435\u0442, \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0441\u0442\u0438\u043b\u044c \u2014 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443. \u0414\u043b\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u2014 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0448\u0435\u0441\u0442\u044c \u2014 \u0443\u043a\u0430\u0436\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 TWIP, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<pre><code>var tableProps = new TableProperties {      TableBorders = new TableBorders     {         LeftBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },         RightBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },         TopBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },         BottomBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },     },     TableLayout = new TableLayout { Type = TableLayoutValues.Fixed } };  var tableGrid = new TableGrid(     new GridColumn { Width = CmToTwip(1).ToString() },     new GridColumn { Width = CmToTwip(3).ToString() },     new GridColumn { Width = CmToTwip(4.5f).ToString() },     new GridColumn { Width = CmToTwip(2.5f).ToString() },     new GridColumn { Width = CmToTwip(3).ToString() },     new GridColumn { Width = CmToTwip(3).ToString() });  var wordTable = new Table(tableProps, tableGrid);   document.MainDocumentPart.Document.Body.Append(wordTable);<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0438\u0442\u0443\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u00a0 \u043e\u0431\u044a\u0435\u043a\u0442 TableRow \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0448\u0435\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 TableCell \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u0440\u0430\u043d\u0438\u0446 \u044f\u0447\u0435\u0439\u043a\u0438. \u041a \u0441\u0430\u043c\u043e\u043c\u0443 \u0442\u0435\u043a\u0441\u0442\u0443 \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0442\u0438\u043b\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<pre><code>var cellBorders = new TableCellBorders {     LeftBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     },     RightBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     },     TopBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     },     BottomBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     }, };   var titleRow = new TableRow(new TableRowProperties(new TableHeader())); var tableTitles = new[] { \"\u2116\", \"\u041a\u043e\u0434\", \"\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\", \"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\", \"\u0426\u0435\u043d\u0430\", \"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\" }; foreach (var title in tableTitles) {     var cell = new TableCell     {         TableCellProperties = new TableCellProperties         {             Shading = new Shading { Fill = \"DDDDDD\", Val = ShadingPatternValues.Clear },             TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true)         }     };          SetCellText(cell, title, JustificationValues.Center);     titleRow.Append(cell); }  wordTable.Append(titleRow);   void SetCellText(TableCell cell, string text, JustificationValues justificationValues, bool? bold = null) {     var paragraphProperties = new ParagraphProperties     {         ParagraphStyleId = new ParagraphStyleId { Val = TableStyleId },         Justification = new Justification { Val = justificationValues },         SpacingBetweenLines = new SpacingBetweenLines         {             After = \"0\",             Line = \"360\",             LineRule = LineSpacingRuleValues.Auto         }     };      cell.Append(new Paragraph(new Run(new Text(text) { Space = SpaceProcessingModeValues.Preserve })         {             RunProperties = bold.HasValue ? new RunProperties { Bold = new Bold { Val = bold.Value } } : null         })         { ParagraphProperties = paragraphProperties }); }<\/code><\/pre>\n<h3>\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u044f\u0447\u0435\u0435\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0448\u0430\u043f\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0448\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 (\u0436\u0438\u0440\u043d\u043e\u0435 \u043d\u0430\u0447\u0435\u0440\u0442\u0430\u043d\u0438\u0435, \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 SetCellText.\u00a0<\/p>\n<p>\u0415\u0449\u0451 \u0440\u0430\u0437 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 OpenXml \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a\u043e\u0432\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 API OpenXml. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0433\u0440\u0430\u043d\u0438\u0446 TableCellBorders \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 cellBorders. \u041a\u043e\u0434 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>var totalSum = 0m; var counter = 1; foreach (var purchasePosition in data.Items) {     var row = new TableRow(new TableRowProperties());      var numberCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(numberCell, counter++.ToString(), JustificationValues.Center);     row.Append(numberCell);      var codeCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(codeCell, purchasePosition.ProductCode, JustificationValues.Center);     row.Append(codeCell);      var nameCell = new TableCell(new TableCellProperties  { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(nameCell, purchasePosition.ProductName, JustificationValues.Left);     row.Append(nameCell);      var countCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(countCell, purchasePosition.Count.ToString(), JustificationValues.Center);     row.Append(countCell);      var priceCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(priceCell, $\"{purchasePosition.UnitPrice} \u0440\u0443\u0431.\", JustificationValues.Center);     row.Append(priceCell);      var sum = purchasePosition.Count * purchasePosition.UnitPrice;     totalSum += sum;     var sumCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(sumCell, $\"{sum} \u0440\u0443\u0431.\", JustificationValues.Center);     row.Append(sumCell);      wordTable.Append(row); }<\/code><\/pre>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0442\u043e\u0433\u043e\u0432<\/h3>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0443\u043c\u043c\u044b \u0437\u0430\u043a\u0430\u0437\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0439 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>var totalCell = new TableCell(new TableCellProperties {     TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true),     GridSpan = new GridSpan { Val = 6 } });  SetCellText(totalCell, $\"\u041e\u0431\u0449\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u0437\u0430\u043a\u0430\u0437\u0430: {totalSum} \u0440\u0443\u0431.\", JustificationValues.Right, bold: true);  var totalRow = new TableRow(new TableRowProperties(), totalCell); wordTable.Append(totalRow);<\/code><\/pre>\n<p>\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 TableCellProperties.GridSpan \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0432\u0441\u0435 \u0448\u0435\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0431\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e TableCellProperties.VerticalMerge. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 GridSpan, \u0432 VerticalMerge \u0443\u0436\u0435 \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0412 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u043f\u043e\u0434 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u043e\u0439, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043d\u043e\u0432\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e VerticalMerge \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c Val=MergedCellValues.Restart.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u043d\u0430\u0448 \u043f\u0435\u0447\u0430\u0442\u043d\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435. \u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3fc\/d3d\/113\/3fcd3d113a60dfcc8dc3f99af9439aec.png\" width=\"693\" height=\"547\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3fc\/d3d\/113\/3fcd3d113a60dfcc8dc3f99af9439aec.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3fc\/d3d\/113\/3fcd3d113a60dfcc8dc3f99af9439aec.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043a\u0430\u0437\u0430, \u0438 \u0442.\u0434. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0442\u0430\u043a\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043f\u0440\u0438\u0435\u043c\u044b \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u0443\u0436\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u044d\u0442\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u044f\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u044b\u0442\u044b \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0437\u0430\u0434\u0430\u043d\u043e \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e \u043b\u0438\u0441\u0442\u0430.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 docx-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d, \u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u0438 \u043e\u0431\u0437\u043e\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0435\u0447\u0430\u0442\u0438 docx \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DocumentFormat.OpenXml. \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenXML. \u0424\u043e\u0440\u043c\u0430\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0446\u0435\u043b\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0435 \u0432\u043e\u0448\u0435\u0434\u0448\u0438\u0435 \u0432 \u043d\u0430\u0448 \u043e\u0431\u0437\u043e\u0440 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b), \u0442\u0430\u043a \u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432: \u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u0431\u043b\u0438\u0446, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u2014 \u0442\u0435\u043a\u0441\u0442, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u0432 .NET.<\/p>\n<p>\u0421 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043f\u043e <a href=\"https:\/\/github.com\/alrodov\/DocxPrintExample\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0410 \u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 DocumentFormat.OpenXml \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 Use-case \u2013 \u043f\u0435\u0447\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 xlsx.<\/p>\n<hr\/>\n<p>\u041c\u044b \u0432 \u00ab\u0411\u0410\u0420\u0421 \u0413\u0440\u0443\u043f\u00bb \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430, \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438 \u043b\u044e\u0434\u0435\u0439. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u041d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u00ab\u0426\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0430\u00bb \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0437\u0430\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u2013 88 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u041f\u041e. \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u0438 \u0418\u0422-\u0442\u0440\u0435\u043d\u0434\u0430\u0445 <a href=\"https:\/\/t.me\/barsgroup_public\">\u0432 Telegram-\u043a\u0430\u043d\u0430\u043b\u0435<\/a>. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0435\u0447\u0430\u0442\u0438 <a href=\"https:\/\/sprinter.ost-digital.ru\/\">Sprinter <\/a>\u00a0\u0442\u0430\u043a\u0436\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440 \u041f\u041e. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c \u0441 \u043f\u0435\u0447\u0430\u0442\u044c\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u043c\u0443 \u0443\u0432\u0438\u0434\u0435\u043b\u0430 \u0441\u0432\u0435\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/900920\/\"> https:\/\/habr.com\/ru\/articles\/900920\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042f \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0420\u043e\u0434\u043e\u0432, \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u00ab\u0411\u0410\u0420\u0421 \u0413\u0440\u0443\u043f\u00bb, \u0430\u0432\u0442\u043e\u0440 \u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0447\u0430\u0442\u043d\u044b\u0445 \u0444\u043e\u0440\u043c Sprinter. \u042d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a DocumentFormat.OpenXml \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0447\u0430\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u00ab\u043e\u0444\u0438\u0441\u043d\u044b\u0445\u00bb \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0432 <a href=\"https:\/\/habr.com\/ru\/companies\/barsgroup\/articles\/893810\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u043c\u044b \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043d\u0430\u0448\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0435\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435. \u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0448\u0430\u043f\u043a\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u043a\u043e\u043b\u043e\u043d\u0442\u0438\u0442\u0443\u043b \u0441 \u043b\u043e\u0433\u043e\u0442\u0438\u043f\u043e\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0432\u044b\u0448\u0435. \u041d\u0443 \u0430 \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0443 \u043d\u0430\u0441 \u2014 \u043f\u0435\u0447\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 docx!<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h3>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 docx \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 OpenXml. \u041e\u0431\u044a\u0435\u043a\u0442 TableProperties \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446 \u0438 \u043c\u0430\u043a\u0435\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442 TableGrid \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0414\u043b\u044f \u0433\u0440\u0430\u043d\u0438\u0446 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0446\u0432\u0435\u0442, \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0441\u0442\u0438\u043b\u044c \u2014 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u0443\u044e \u0433\u0440\u0430\u043d\u0438\u0446\u0443. \u0414\u043b\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u2014 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0448\u0435\u0441\u0442\u044c \u2014 \u0443\u043a\u0430\u0436\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 TWIP, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<pre><code>var tableProps = new TableProperties {      TableBorders = new TableBorders     {         LeftBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },         RightBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },         TopBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },         BottomBorder = new()         {             Color = DefaultColor,             Size = 12u,             Val = BorderValues.Single         },     },     TableLayout = new TableLayout { Type = TableLayoutValues.Fixed } };  var tableGrid = new TableGrid(     new GridColumn { Width = CmToTwip(1).ToString() },     new GridColumn { Width = CmToTwip(3).ToString() },     new GridColumn { Width = CmToTwip(4.5f).ToString() },     new GridColumn { Width = CmToTwip(2.5f).ToString() },     new GridColumn { Width = CmToTwip(3).ToString() },     new GridColumn { Width = CmToTwip(3).ToString() });  var wordTable = new Table(tableProps, tableGrid);   document.MainDocumentPart.Document.Body.Append(wordTable);<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0438\u0442\u0443\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c\u00a0 \u043e\u0431\u044a\u0435\u043a\u0442 TableRow \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0448\u0435\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 TableCell \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u0440\u0430\u043d\u0438\u0446 \u044f\u0447\u0435\u0439\u043a\u0438. \u041a \u0441\u0430\u043c\u043e\u043c\u0443 \u0442\u0435\u043a\u0441\u0442\u0443 \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0442\u0438\u043b\u0435\u0439 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<pre><code>var cellBorders = new TableCellBorders {     LeftBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     },     RightBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     },     TopBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     },     BottomBorder = new()     {         Color = DefaultColor,         Size = 12u,         Val = BorderValues.Single     }, };   var titleRow = new TableRow(new TableRowProperties(new TableHeader())); var tableTitles = new[] { \"\u2116\", \"\u041a\u043e\u0434\", \"\u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\", \"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\", \"\u0426\u0435\u043d\u0430\", \"\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\" }; foreach (var title in tableTitles) {     var cell = new TableCell     {         TableCellProperties = new TableCellProperties         {             Shading = new Shading { Fill = \"DDDDDD\", Val = ShadingPatternValues.Clear },             TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true)         }     };          SetCellText(cell, title, JustificationValues.Center);     titleRow.Append(cell); }  wordTable.Append(titleRow);   void SetCellText(TableCell cell, string text, JustificationValues justificationValues, bool? bold = null) {     var paragraphProperties = new ParagraphProperties     {         ParagraphStyleId = new ParagraphStyleId { Val = TableStyleId },         Justification = new Justification { Val = justificationValues },         SpacingBetweenLines = new SpacingBetweenLines         {             After = \"0\",             Line = \"360\",             LineRule = LineSpacingRuleValues.Auto         }     };      cell.Append(new Paragraph(new Run(new Text(text) { Space = SpaceProcessingModeValues.Preserve })         {             RunProperties = bold.HasValue ? new RunProperties { Bold = new Bold { Val = bold.Value } } : null         })         { ParagraphProperties = paragraphProperties }); }<\/code><\/pre>\n<h3>\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u044f\u0447\u0435\u0435\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0448\u0430\u043f\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438\u0448\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 (\u0436\u0438\u0440\u043d\u043e\u0435 \u043d\u0430\u0447\u0435\u0440\u0442\u0430\u043d\u0438\u0435, \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434 SetCellText.\u00a0<\/p>\n<p>\u0415\u0449\u0451 \u0440\u0430\u0437 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 OpenXml \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442\u0430\u043a\u043e\u0432\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 API OpenXml. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0433\u0440\u0430\u043d\u0438\u0446 TableCellBorders \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 cellBorders. \u041a\u043e\u0434 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>var totalSum = 0m; var counter = 1; foreach (var purchasePosition in data.Items) {     var row = new TableRow(new TableRowProperties());      var numberCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(numberCell, counter++.ToString(), JustificationValues.Center);     row.Append(numberCell);      var codeCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(codeCell, purchasePosition.ProductCode, JustificationValues.Center);     row.Append(codeCell);      var nameCell = new TableCell(new TableCellProperties  { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(nameCell, purchasePosition.ProductName, JustificationValues.Left);     row.Append(nameCell);      var countCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(countCell, purchasePosition.Count.ToString(), JustificationValues.Center);     row.Append(countCell);      var priceCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(priceCell, $\"{purchasePosition.UnitPrice} \u0440\u0443\u0431.\", JustificationValues.Center);     row.Append(priceCell);      var sum = purchasePosition.Count * purchasePosition.UnitPrice;     totalSum += sum;     var sumCell = new TableCell(new TableCellProperties { TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true) });     SetCellText(sumCell, $\"{sum} \u0440\u0443\u0431.\", JustificationValues.Center);     row.Append(sumCell);      wordTable.Append(row); }<\/code><\/pre>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0442\u043e\u0433\u043e\u0432<\/h3>\n<p>\u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0443\u043c\u043c\u044b \u0437\u0430\u043a\u0430\u0437\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0439 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>var totalCell = new TableCell(new TableCellProperties {     TableCellBorders = (TableCellBorders)cellBorders.CloneNode(true),     GridSpan = new GridSpan { Val = 6 } });  SetCellText(totalCell, $\"\u041e\u0431\u0449\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u0437\u0430\u043a\u0430\u0437\u0430: {totalSum} \u0440\u0443\u0431.\", JustificationValues.Right, bold: true);  var totalRow = new TableRow(new TableRowProperties(), totalCell); wordTable.Append(totalRow);<\/code><\/pre>\n<p>\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 TableCellProperties.GridSpan \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0432\u0441\u0435 \u0448\u0435\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u044f\u0447\u0435\u0435\u043a, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0431\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e TableCellProperties.VerticalMerge. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 GridSpan, \u0432 VerticalMerge \u0443\u0436\u0435 \u043d\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435. \u0412 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u043f\u043e\u0434 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u043e\u0439, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043d\u043e\u0432\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e VerticalMerge \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c Val=MergedCellValues.Restart.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u043d\u0430\u0448 \u043f\u0435\u0447\u0430\u0442\u043d\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u043a\u0430\u0437\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435. \u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0447\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043a\u0430\u0437\u0430, \u0438 \u0442.\u0434. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0442\u0430\u043a\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043f\u0440\u0438\u0435\u043c\u044b \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b \u0443\u0436\u0435 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u044d\u0442\u043e\u0439 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u044f\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u0440\u044b\u0442\u044b \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0437\u0430\u0434\u0430\u043d\u043e \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e \u043b\u0438\u0441\u0442\u0430.<\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 docx-\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d, \u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u0438 \u043e\u0431\u0437\u043e\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0435\u0447\u0430\u0442\u0438 docx \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e DocumentFormat.OpenXml. \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenXML. \u0424\u043e\u0440\u043c\u0430\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0446\u0435\u043b\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0435 \u0432\u043e\u0448\u0435\u0434\u0448\u0438\u0435 \u0432 \u043d\u0430\u0448 \u043e\u0431\u0437\u043e\u0440 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b), \u0442\u0430\u043a \u0438 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432: \u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u0431\u043b\u0438\u0446, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u2014 \u0442\u0435\u043a\u0441\u0442, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u0432 .NET.<\/p>\n<p>\u0421 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u043f\u043e <a href=\"https:\/\/github.com\/alrodov\/DocxPrintExample\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u0410 \u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 DocumentFormat.OpenXml \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 Use-case \u2013 \u043f\u0435\u0447\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 xlsx.<\/p>\n<hr\/>\n<p>\u041c\u044b \u0432 \u00ab\u0411\u0410\u0420\u0421 \u0413\u0440\u0443\u043f\u00bb \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430, \u0431\u0438\u0437\u043d\u0435\u0441\u0430 \u0438 \u043b\u044e\u0434\u0435\u0439. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u041d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u00ab\u0426\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043a\u0430\u00bb \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0437\u0430\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u2013 88 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u041f\u041e. \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445 \u0438 \u0418\u0422-\u0442\u0440\u0435\u043d\u0434\u0430\u0445 <a href=\"https:\/\/t.me\/barsgroup_public\">\u0432 Telegram-\u043a\u0430\u043d\u0430\u043b\u0435<\/a>. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0435\u0447\u0430\u0442\u0438 <a href=\"https:\/\/sprinter.ost-digital.ru\/\">Sprinter <\/a>\u00a0\u0442\u0430\u043a\u0436\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440 \u041f\u041e. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c \u0441<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-456138","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=456138"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/456138\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=456138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=456138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=456138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}