Пример #1
0
        public void SetColumnsWidths(double[] colWidths)
        {
            var colName = "A";

            foreach (var width in colWidths)
            {
                _writer.SetColumnWidth(colName, width);
                colName = SpreadsheetReader.GetColumnName(colName, 1);
            }
        }
Пример #2
0
        public void WriteCellFormatted(string column, int row, string value, SpreadsheetStyle style = null,
                                       int colSpan = 0)
        {
            WriteCell(column, row, value, style);

            if (colSpan > 0)
            {
                var endCell = SpreadsheetReader.GetColumnName(column, colSpan - 1) + row;
                _writer.MergeCells(column + row, endCell);
            }
        }
Пример #3
0
        public void WriteRow(string column, int row, List <string> values, SpreadsheetStyle style = null)
        {
            var startCell = column + row;

            _writer.PasteValues(startCell, values, CellValues.String);

            if (style != null)
            {
                var endCell = SpreadsheetReader.GetColumnName(column, values.Count - 1) + row;
                _writer.SetStyle(style, startCell, endCell);
            }
        }
Пример #4
0
            public void WriteOptions()
            {
                var column = "Y";

                foreach (var o in _options)
                {
                    _writer.WriteCell(column, 1, o.OptionName, _headerStyle);

                    foreach (var ov in o.RowValues)
                    {
                        _writer.WriteCell(column, ov.RowIndex, ov.Value);
                    }

                    column = SpreadsheetReader.GetColumnName(column, 1);
                }
            }
Пример #5
0
 protected string GetNextColumn(string colname)
 {
     return(SpreadsheetReader.GetColumnName(colname, 1));
 }