Export to Excel from a databoundgrid works well, but wondering if I can control the visual appearance of the exported worksheet once it's opened in Excel. The data cells have no borders (cell grids). Please see the attached screen print. Here is the code I use to create and save the xls file:
Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
string path = "";
if (dlgSaveFile.ShowDialog() == DialogResult.OK)
{
path = dlgSaveFile.FileName;
}
// Create Excel automation objects
IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(1);
IWorksheet sheet = myWorkBook.Worksheets[0];
gecc.GridToExcel(gridSearchResults.Model, sheet, Syncfusion.GridExcelConverter.ConverterOptions.RowHeaders
| Syncfusion.GridExcelConverter.ConverterOptions.RowHeaders
| Syncfusion.GridExcelConverter.ConverterOptions.Default);
// Save the workbook to disk so we can launch it via the file system
myWorkBook.SaveAs(path);
myWorkBook.Close();
ExcelUtils.ThrowNotSavedOnDestroy = false;
Thanks in advance.
-Dan
ExcelPrint1.zip