/// <summary> /// Создать новый подзаголовок /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <returns></returns> private TableRow NewSubtitle(TablesRow NewRow) { UInt32 RowHeight = 284U; int LeftIndentation = -113; int RightIndentation = -113; JustificationValues JustificationValue = JustificationValues.Center; int FontSize = 11; TableRow tableRow = CalibrationLib.NewTableRow(RowHeight); int[] CellWidthValues = GetCellWidthValues(NewRow); TableCell TableCell1 = tableRow.AddTableCell(CellWidthValues[0], NewRow.Values[0], LeftIndentation, RightIndentation, JustificationValue, FontSize, NewRow.GridSpan[0]); TableCell1.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); TableCell TableCell2 = tableRow.AddTableCell(CellWidthValues[1], NewRow.Values[1], LeftIndentation, RightIndentation, JustificationValue, FontSize, NewRow.GridSpan[1]); TableCell2.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); TableCell TableCell3 = tableRow.AddTableCell(CellWidthValues[2], NewRow.Values[2], LeftIndentation, RightIndentation, JustificationValue, FontSize, NewRow.GridSpan[2]); TableCell3.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); TableCell TableCell4 = tableRow.AddTableCell(CellWidthValues[3], NewRow.Values[3], LeftIndentation, RightIndentation, JustificationValue, FontSize, NewRow.GridSpan[3]); TableCell4.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); return(tableRow); }
/// <summary> /// Создать шапку таблицы. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <param name="TableWidth"> Ширина столбца. </param> /// <returns></returns> internal TableRow CreateHeader(TablesRow NewRow, int[] ColumnsWidthList) { TableRow NewTableRow = CalibrationLib.NewTableRow((UInt32Value)284U); for (int i = 0; i < NewRow.ColumnsCount; i++) { TableCell NewTableCell = NewTableRow.AddTableCell(ColumnsWidthList[i], NewRow.Values[i], -113, -113, JustificationValues.Center, 12, NewRow.GridSpan[i], false, false, NewRow.VerticalMerge[i]); NewTableCell.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); } return(NewTableRow); }
/// <summary> /// Изменить строку таблицы. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <param name="TableWidth"> Ширина столбца. </param> /// <returns></returns> internal void ChangingRow(TablesRow NewRow, TableRow ChRow) { IEnumerable <TableCell> CellCollection = ChRow.Elements <TableCell>(); for (int i = 0; i < NewRow.ColumnsCount; i++) { if (NewRow.Values[i] != "") { CellCollection.ElementAt(i).Elements <Paragraph>().First().Elements <Run>().First().Append(CalibrationLib.NewText(NewRow.Values[i])); } } }
/// <summary> /// Создать заголовок таблицы. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <param name="TableWidth"> Ширина столбца. </param> /// <returns></returns> internal TableRow CreateTitle(TablesRow NewRow, int TableWidth) { TableRow NewTableRow = CalibrationLib.NewTableRow((UInt32Value)284U); for (int i = 0; i < NewRow.ColumnsCount; i++) { TableCell NewTableCell = NewTableRow.AddTableCell(TableWidth / NewRow.ColumnsCount, NewRow.Values[i], -113, -113, JustificationValues.Left, 12, ColumnsCount, false, false); NewTableCell.SetBorders(BorderValues.Nil, BorderValues.Nil, BorderValues.Nil, BorderValues.Nil); } return(NewTableRow); }
/// <summary> /// Создать результирующую строку таблицы. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <param name="TableWidth"> Ширина столбца. </param> /// <returns></returns> internal TableRow CreateResult(TablesRow NewRow, int TableWidth) { TableRow NewTableRow = CalibrationLib.NewTableRow((UInt32Value)198U); for (int i = 0; i < NewRow.ColumnsCount; i++) { TableCell NewTableCell = NewTableRow.AddTableCell(TableWidth / NewRow.ColumnsCount, NewRow.Values[i], -113, -113, JustificationValues.Center, 8, NewRow.GridSpan[i], false, true, NewRow.VerticalMerge[i]); NewTableCell.SetBorders(BorderValues.Nil, BorderValues.Nil, BorderValues.Nil, BorderValues.Nil); } return(NewTableRow); }
/// <summary> /// Создать подзаголовок таблицы. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <param name="TableWidth"> Ширина столбца. </param> /// <returns></returns> internal TableRow CreateSubTitle(TablesRow NewRow, int TableWidth) { TableRow NewTableRow = CalibrationLib.NewTableRow((UInt32Value)198U); for (int i = 0; i < NewRow.ColumnsCount; i++) { TableCell NewTableCell = NewTableRow.AddTableCell(TableWidth / NewRow.ColumnsCount, NewRow.Values[0], -113, -113, JustificationValues.Center, 8, ColumnsCount, false, true); NewTableCell.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); } return(NewTableRow); }
/// <summary> /// Создать обычную строку таблицы. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <param name="TableWidth"> Ширина столбца. </param> /// <returns></returns> internal TableRow CreateSimpleRow(TablesRow NewRow, int[] ColumnsWidthList) { TableRow NewTableRow = CalibrationLib.NewTableRow((UInt32Value)198U); for (int i = 0; i < NewRow.ColumnsCount; i++) { bool Italic = i == 0 ? false : true; TableCell NewTableCell = NewTableRow.AddTableCell(ColumnsWidthList[i], NewRow.Values[i], -113, -113, JustificationValues.Center, 8, NewRow.GridSpan[i], false, Italic, NewRow.VerticalMerge[i]); NewTableCell.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); } return(NewTableRow); }
/// <summary> /// Получить значения ширины столбцов. /// </summary> /// <param name="CurrentRow"> Строка таблицы. </param> /// <returns></returns> private int[] GetCellWidthValues(TablesRow CurrentRow) { int[] CellWidthValues = new int[CurrentRow.Values.Count()]; int j = 0; for (int i = 0; i < CurrentRow.Values.Count(); i++) { CellWidthValues[i] = 0; for (int k = 0; k < CurrentRow.GridSpan[i]; k++) { CellWidthValues[i] = CellWidthValues[i] + ColumnsWidth[j]; j++; } } return(CellWidthValues); }
/// <summary> /// Создать новую шапку таблицы. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <returns></returns> private TableRow NewHeader(TablesRow NewRow) { UInt32 RowHeight = 284U; int LeftIndentation = -113; int RightIndentation = -113; JustificationValues JustificationValue = JustificationValues.Left; int FontSize = 11; TableRow tableRow = CalibrationLib.NewTableRow(RowHeight); int[] CellWidthValues = GetCellWidthValues(NewRow); TableCell TableCell1 = tableRow.AddTableCell(CellWidthValues[0], NewRow.Values[0], LeftIndentation, RightIndentation, JustificationValue, FontSize, NewRow.GridSpan[0]); TableCell1.SetBorders(BorderValues.Nil, BorderValues.Nil, BorderValues.Nil, BorderValues.Nil); return(tableRow); }
/// <summary> /// Создать обычную строку /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <returns></returns> private TableRow NewSimpleRow(TablesRow NewRow) { UInt32 RowHeight = 284U; int LeftIndentation = -113; int RightIndentation = -113; JustificationValues JustificationValue = JustificationValues.Center; int FontSize = 11; TableRow tableRow = CalibrationLib.NewTableRow(RowHeight); int[] CellWidthValues = GetCellWidthValues(NewRow); for (int i = 0; i < NewRow.Values.Count(); i++) { TableCell tableCell = tableRow.AddTableCell(CellWidthValues[i], NewRow.Values[i], LeftIndentation, RightIndentation, JustificationValue, FontSize, NewRow.GridSpan[i]); tableCell.SetBorders(BorderValues.Single, BorderValues.Single, BorderValues.Single, BorderValues.Single); } return(tableRow); }
/// <summary> /// Создать новую результирующую строку. /// </summary> /// <param name="NewRow"> Строка таблицы. </param> /// <returns></returns> private TableRow NewResult(TablesRow NewRow) { UInt32 RowHeight = 284U; int LeftIndentation = -57; int RightIndentation = -57; int FontSize = 10; TableRow tableRow = CalibrationLib.NewTableRow(RowHeight); int[] CellWidthValues = GetCellWidthValues(NewRow); TableCell TableCell1 = tableRow.AddTableCell(CellWidthValues[0], NewRow.Values[0], LeftIndentation, RightIndentation, JustificationValues.Left, FontSize, NewRow.GridSpan[0]); TableCell1.SetBorders(BorderValues.Nil, BorderValues.Nil, BorderValues.Nil, BorderValues.Nil); TableCell TableCell2 = tableRow.AddTableCell(CellWidthValues[1], NewRow.Values[1], LeftIndentation, RightIndentation, JustificationValues.Center, FontSize, NewRow.GridSpan[1]); TableCell2.SetBorders(BorderValues.Nil, BorderValues.Nil, BorderValues.Single, BorderValues.Nil); TableCell TableCell3 = tableRow.AddTableCell(CellWidthValues[2], NewRow.Values[2], LeftIndentation, RightIndentation, JustificationValues.Left, FontSize, NewRow.GridSpan[2]); TableCell3.SetBorders(BorderValues.Nil, BorderValues.Nil, BorderValues.Nil, BorderValues.Nil); return(tableRow); }