Posted 17 December 2020, 12:34 am EST
Hi,
I have a issue when I import file excel .xlsx to spread. The problem at function sheet.OpenExcel(ms, 0) it can’t Open MemoryStream, also the MemoryStream have data. Please help me. My code like.
void Import_Click(object sender, EventArgs e){
byte data = Convert.FromBase64String(fileData.Value);
MemoryStream ms = new MemoryStream(data);
FarPoint.Web.Spread.SheetView sheet = new FarPoint.Web.Spread.SheetView(); sheet.SheetName = "sheet1"; sheet.OpenExcel(ms, 0);
…
var a = sheet.Cells[0, 0].Value.ToString(), 0;
// Error in this because sheet not have a value.
}
this is my function download excel using flag like
void btnExcel_Click(object sender, EventArgs e){
FarPoint.Web.Spread.FpSpread temp = new FarPoint.Web.Spread.FpSpread();
FarPoint.Web.Spread.SheetView sht = new FarPoint.Web.Spread.SheetView();
CopySheet(FpSpread1.ActiveSheetView, sht);
…
var flags = FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat | FarPoint.Excel.ExcelSaveFlags.SaveCustomColumnHeaders;
var data = ExportExcelData(temp, flags);
…
}