After using SaveFileDialog and buiding the filestream, I do Workbook.Save(filestream). After this the contents of the grid is exported and saved in the excel sheet. Our users however want the excel sheet to remain open? Even better solution would be to build the filestream and popup a prompt for the user to either Open or Save or Cancel the operation. How do I do it?
Is your application running in the browser? Whether it is out-of-browser or not will make a difference.
Thanks,
Its within a browser. I am exporting it from XamGrid.
SaveFileDialog dialog = new SaveFileDialog {"Excel 2003 files (.xls)|*.xls" , DefaultExt = "xls"
Filter =
};
bool? showDialog = dialog.ShowDialog();
if (showDialog == true )
{
using (Stream exportStream = dialog.OpenFile())
try {WorkbookFormat workbookFormat = WorkbookFormat.Excel97To2003;
Workbook dataWorkbook = new Workbook (workbookFormat);
. . .
// save the workbook
dataWorkbook.Save(exportStream);
}