Workbook workbook = new Workbook(); // create a worksheet object Worksheet worksheet = new Worksheet("Enterprise_Summary_Reports"); // for header foreach (DataGridColumn dgcol in datagrid1.Columns) { worksheet.Cells[0, ColumnCount] = new Cell(dgcol.Header.ToString()); CellStyle css = new CellStyle(); css.BackColor = (Color)Colors.Red; worksheet.Cells[0, ColumnCount].Style = css; ColumnCount++; } // statements for adding rows workbook.Worksheets.Add(worksheet); // get the selected file's stream Stream sFile = sDialog.OpenFile(); workbook.Save(sFile);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)