Exemple #1
0
 public void WriteTableCellBegin(int cellIndex, int numColumns, bool firstVertMerge, bool firstHorzMerge, bool vertMerge, bool horzMerge)
 {
     if (this._state == State.InRow)
     {
         this._state       = State.InCell;
         this._currentCell = new OpenXmlTableCellModel(this.CurrentCell, this._currentTable.TableProperties, this._interleavingWriter.TextWriter);
         this._currentCell.CellProperties.Width = this._currentRow.ColumnWidths[cellIndex];
         if (firstHorzMerge)
         {
             this._currentCell.CellProperties.HorizontalMerge = OpenXmlTableCellPropertiesModel.MergeState.Start;
         }
         else if (horzMerge)
         {
             this._currentCell.CellProperties.HorizontalMerge = OpenXmlTableCellPropertiesModel.MergeState.Continue;
         }
         if (firstVertMerge)
         {
             this._currentCell.CellProperties.VerticalMerge = OpenXmlTableCellPropertiesModel.MergeState.Start;
         }
         else if (vertMerge)
         {
             this._currentCell.CellProperties.VerticalMerge = OpenXmlTableCellPropertiesModel.MergeState.Continue;
         }
         this._currentCell.CellProperties.BackgroundColor = this._currentTable.TableProperties.BackgroundColor;
     }
     else
     {
         WordOpenXmlUtils.FailCodingError();
     }
 }
        public void WriteCellDiagonal(int cellIndex, RPLFormat.BorderStyles style, string width, string color, bool slantUp)
        {
            OpenXmlTableCellModel        currentCell = this._document.TableContext.CurrentCell;
            OpenXmlBorderPropertiesModel openXmlBorderPropertiesModel = slantUp ? currentCell.CellProperties.BorderDiagonalUp : currentCell.CellProperties.BorderDiagonalDown;

            openXmlBorderPropertiesModel.Color = WordOpenXmlUtils.RgbColor(new RPLReportColor(color).ToColor());
            openXmlBorderPropertiesModel.Style = this.RPLFormatToBorderStyle(style);
            openXmlBorderPropertiesModel.WidthInEighthPoints = (int)Math.Floor(new RPLReportSize(width).ToPoints() * 8.0);
        }
Exemple #3
0
 public void WriteTableCellEnd(int cellIndex, BorderContext borderContext, bool emptyLayoutCell)
 {
     if (this._state == State.InCell)
     {
         this.CurrentCell.WriteCloseTag(emptyLayoutCell);
         this._currentCell = this.CurrentCell.ContainingCell;
         this._state       = State.InRow;
     }
     else
     {
         WordOpenXmlUtils.FailCodingError();
     }
 }
        public void ApplyCellBorderContext(BorderContext borderContext)
        {
            OpenXmlTableCellModel currentCell = this._document.TableContext.CurrentCell;

            if (borderContext.Top)
            {
                currentCell.UseTopTableBorder();
            }
            if (borderContext.Bottom)
            {
                currentCell.UseBottomTableBorder();
            }
            if (borderContext.Left)
            {
                currentCell.UseLeftTableBorder();
            }
            if (borderContext.Right)
            {
                currentCell.UseRightTableBorder();
            }
        }