Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ...
- foreach (DataRow row in data.Rows)
- {
- IRow dataRow = mainSheet.CreateRow(rowIndex);
- foreach (DataColumn column in data.Columns)
- {
- ICell cell = dataRow.CreateCell(column.Ordinal);
- if (row[column] is string)
- {
- cell.SetCellValue((string)row[column]);
- //cell.SetCellType(CellType.STRING);
- }
- else if (row[column] is uint)
- {
- cell.SetCellValue((uint)row[column]);
- // cell.SetCellType(CellType.NUMERIC);
- }
- else if (row[column] is int)
- {
- cell.SetCellValue((int)row[column]);
- //cell.SetCellType(CellType.NUMERIC);
- }
- cell.CellStyle = cellStyle;
- }
- rowIndex++;
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement