Exemplo n.º 1
0
        private void WriteDataValue(uint rowIndex, uint columnIndex, object value)
        {
            string columnName = ExcelUtility.GetColumnNameFromIndex(columnIndex);
            IEnumerable <object> listValue = value as IEnumerable <object>;

            if (listValue != null)
            {
                value = string.Join(", ", listValue.Where(item => item != null).Select(item => item.ToString()));
            }
            ExcelUtility.SetSharedStringCell(Document, Worksheet, columnName, rowIndex, value.ToString());
        }
Exemplo n.º 2
0
        private void WriteColumnHeading(uint columnIndex, string headerName)
        {
            string columnName = ExcelUtility.GetColumnNameFromIndex(columnIndex);

            ExcelUtility.EnsureColumn(Worksheet, columnIndex);
            if (columnIndex > 1)
            {
                ExcelUtility.CopyCell(Worksheet, "A", HeaderRowIndex, columnName, HeaderRowIndex);
            }
            ExcelUtility.SetSharedStringCell(Document, Worksheet, columnName, HeaderRowIndex, headerName);
        }