This project is read-only.

Can't save data to outputstream. SpreadsheetDocumentWrapper.Open(stream input,stream output)

Mar 28, 2014 at 7:23 AM
Hi, I want to export excel data to client. the target file have been added 10 rows whose color is blue the same to template file. but there is no data in the 10 rows.
                string strBusinessName = ddlBusiness.SelectedValue;
                string FileName = strBusinessName + "-AllRuns-GridData" + ".xlsx";

                System.Data.DataTable dt = GetGridViewData(gvHcRpt);
                string strPath = Page.MapPath("~\Excel_templates\") + "HC_DataDump" + ".xlsx";

                Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                this.Response.AddHeader("Content-Disposition", "attachment; filename="+FileName); 

                using (var input = new FileStream (strPath,FileMode.Open,FileAccess.ReadWrite))

                using (SpreadsheetDocumentWrapper myPackage = SpreadsheetDocumentWrapper.Open(input,Response.OutputStream))
                    ExtremeML.Spreadsheet.TableWrapper myTable = myPackage.WorkbookPart.GetTablePart("export_table").Table;