Posted 1 May 2019, 12:30 am EST
Hi,
My server code uses Apache POI to create a workbook and then converts it to bytes and sends the response. At ui side I am trying to import this byte using excelIO as mentioned in this link https://www.grapecity.com/blogs/how-to-importexport-excel-files-using-javascript-and-spread-sheets .
Below is my code
function loadBlob(response)
{
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('wBook'), {
sheetCount: 0
});
var excelIO = new GC.Spread.Excel.IO();
excelIO.open(response.excelStream, function(json){
workbook.fromJSON(json);
spread.setActiveSheetIndex(0);
}, function (message) {
console.log(message);
});
}
But I get below error
Failed to execute ‘readAsArrayBuffer’ on ‘FileReader’: parameter 1 is not of type ‘Blob’.
Can someone please tell me what I am doing wrong here
