private Wordprocessing.Table doptable2(Wordprocessing.Table table) { for (int i = 1; i <= 5; i++) { //Первый столбец Wordprocessing.TableRow tableRow = new Wordprocessing.TableRow(); Wordprocessing.TableCell tableCell1 = new Wordprocessing.TableCell(); Wordprocessing.TableCellProperties tableCellProperties1 = new Wordprocessing.TableCellProperties(); Wordprocessing.TableCellWidth tableCellWidth1 = new Wordprocessing.TableCellWidth() { Width = "0", Type = Wordprocessing.TableWidthUnitValues.Auto }; Wordprocessing.GridSpan gridSpan1 = new Wordprocessing.GridSpan() { Val = 3 }; Wordprocessing.VerticalMerge verticalMerge1; if (i==1) verticalMerge1 = new Wordprocessing.VerticalMerge() { Val = Wordprocessing.MergedCellValues.Restart }; else verticalMerge1 = new Wordprocessing.VerticalMerge(); tableCellProperties1.Append(tableCellWidth1); tableCellProperties1.Append(gridSpan1); tableCellProperties1.Append(verticalMerge1); tableCell1.Append(tableCellProperties1); if (i == 1) { for (int j=1; j<5; j++) tableCell1.Append(retText(j, 1)); } else tableCell1.Append(retText(i, 1)); tableRow.Append(tableCell1); //Второй столбец Wordprocessing.TableCell tableCell2 = new Wordprocessing.TableCell(); Wordprocessing.TableCellProperties tableCellProperties2 = new Wordprocessing.TableCellProperties(); Wordprocessing.TableCellWidth tableCellWidth2 = new Wordprocessing.TableCellWidth() { Width = "0", Type = Wordprocessing.TableWidthUnitValues.Auto }; Wordprocessing.VerticalMerge verticalMerge2; if (i == 1) verticalMerge2 = new Wordprocessing.VerticalMerge() { Val = Wordprocessing.MergedCellValues.Restart }; else verticalMerge2 = new Wordprocessing.VerticalMerge(); tableCellProperties2.Append(tableCellWidth2); tableCellProperties2.Append(verticalMerge2); tableCell2.Append(tableCellProperties2); tableCell2.Append(retText(i, 2)); tableRow.Append(tableCell2); for (int j = 0; j < 2; j++) { Wordprocessing.TableCell tableCell3 = new Wordprocessing.TableCell(); Wordprocessing.TableCellProperties tableCellProperties3 = new Wordprocessing.TableCellProperties(); Wordprocessing.TableCellWidth tableCellWidth3 = new Wordprocessing.TableCellWidth() { Width = "0", Type = Wordprocessing.TableWidthUnitValues.Auto }; tableCellProperties3.Append(tableCellWidth3); tableCell3.Append(tableCellProperties3); tableCell3.Append(retText(i, j + 3)); tableRow.Append(tableCell3); } table.Append(tableRow); } Wordprocessing.TableRow tableRowrlast = new Wordprocessing.TableRow(); Wordprocessing.TableCell tableCellrlast = new Wordprocessing.TableCell(); Wordprocessing.TableCellProperties tableCellPropertiesrlast = new Wordprocessing.TableCellProperties(); Wordprocessing.TableCellWidth tableCellWidthrlast = new Wordprocessing.TableCellWidth() { Width = "0", Type = Wordprocessing.TableWidthUnitValues.Auto }; Wordprocessing.GridSpan gridSpanrlast = new Wordprocessing.GridSpan() { Val = 3 }; Wordprocessing.VerticalMerge verticalMergerlast = new Wordprocessing.VerticalMerge(); tableCellPropertiesrlast.Append(tableCellWidthrlast); tableCellPropertiesrlast.Append(gridSpanrlast); tableCellPropertiesrlast.Append(verticalMergerlast); tableCellrlast.Append(tableCellPropertiesrlast); tableCellrlast.Append(retText(-1, -1)); Wordprocessing.TableCell tableCellrlast1 = new Wordprocessing.TableCell(); Wordprocessing.TableCellProperties tableCellPropertiesrlast1 = new Wordprocessing.TableCellProperties(); Wordprocessing.TableCellWidth tableCellWidthrlast1 = new Wordprocessing.TableCellWidth() { Width = "0", Type = Wordprocessing.TableWidthUnitValues.Auto }; Wordprocessing.GridSpan gridSpanrlast1 = new Wordprocessing.GridSpan() { Val = 3 }; tableCellPropertiesrlast1.Append(tableCellWidthrlast1); tableCellPropertiesrlast1.Append(gridSpanrlast1); tableCellrlast1.Append(tableCellPropertiesrlast1); tableCellrlast1.Append(retText(0, 0)); tableRowrlast.Append(tableCellrlast); tableRowrlast.Append(tableCellrlast1); table.Append(tableRowrlast); return table; }
private Wordprocessing.Table doptable(Wordprocessing.Table table) { //Строка подпись декана Wordprocessing.TableRow tableRow2 = new Wordprocessing.TableRow() { RsidTableRowAddition = "00FF67BF", RsidTableRowProperties = "008E2483" }; Wordprocessing.TableCell tableCell = new Wordprocessing.TableCell(); Wordprocessing.TableCellProperties tableCellProperties = new Wordprocessing.TableCellProperties(); Wordprocessing.TableCellWidth tableCellWidth = new Wordprocessing.TableCellWidth() { Width = "0", Type = Wordprocessing.TableWidthUnitValues.Auto }; Wordprocessing.GridSpan gridSpan = new Wordprocessing.GridSpan() { Val = 6 }; Wordprocessing.TableCellVerticalAlignment tableCellVerticalAlignment = new Wordprocessing.TableCellVerticalAlignment() { Val = Wordprocessing.TableVerticalAlignmentValues.Center }; tableCellProperties.Append(tableCellWidth); tableCellProperties.Append(gridSpan); tableCellProperties.Append(tableCellVerticalAlignment); Wordprocessing.Paragraph paragraph = new Wordprocessing.Paragraph(); Wordprocessing.ParagraphProperties parprop = new Wordprocessing.ParagraphProperties(); Wordprocessing.SpacingBetweenLines spacingBetweenLines2 = new Wordprocessing.SpacingBetweenLines() { After = "0" }; parprop.Append(spacingBetweenLines2); paragraph.Append(parprop); Wordprocessing.Run run = new Wordprocessing.Run(); Wordprocessing.Text text = new Wordprocessing.Text(); text.Text = "Подпись декана"; run.Append(text); paragraph.Append(run); tableCell.Append(tableCellProperties); tableCell.Append(paragraph); tableRow2.Append(tableCell); table.Append(tableRow2); return table; }