Hi,
I tried to simple copy and paste your sample about Client-Side Excel Library - Overview on a local environment.
I did different tests:
I have a problem just before to export data to Excel.
Error exporting: JSZip is not defined
setTimeout(function () {
// Finally, save the workbook and create a link so the .xlsx document can be downloadedworkbook.save(function (err, data) { if (err) { $status.text("Error exporting: " + getErrorMessage(err)); } else { var blob = new Blob([data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }); saveAs(blob, "grid.xlsx"); $status.text("Export complete"); }});
}, 1);
And, of course, I have that error and null data as callback function from the save one.
Even if I try to set a Workbook format that is not equal to excel2007, for example excel97To2003, I get an error. Of course it is not a missing JSZip, but a Xml_DefaultException with a null exception message...
Any ideas?
Thanks
Flavio M.
Hello Flavio,
Thank you for contacting Infragistics!
I have done some looking into this matter and have the following information. First I would like to note that the client side excel export is still in CTP and therefore not recommended or supported to be used in production environment. So far I have been unable to reproduce the issue you are using. I am attaching my sample please let me know what behavior you see when you run the sample.
Do you have an isolated sample you can provide to me that reproduces the issue?
Hi Mike!
Thank you very much for your sample. I was able to start the Excel exportation (to be honest I didn't find where is the bug on the online sample on my pc, but I see there are a lot of functions on the web sample that are not contemplated in yours).
Anyway, just one more thing: the system exports an Excel file, but I am not able to open it... It asks me again to save the file when I open it, and it says to me that the format is not correct...
Thansk in advance
Thank you for the update. When I try to open the excel file on my machine I am able to do without issue. Do you have excel installed on your machine? Do you get any errors on export?
of course: I have Excel installed on my laptop. And no, no errors during exports...
What version of Excel do you have installed on your machine, what happens if you update the workbook type on exporting to be:
$.ig.excel.Workbook($.ig.excel.WorkbookFormat.excel2007);
Sorry Mike,
you were right. I had a problem with Excel installation on my virtual machine. Solved it, I was able to solve the error related to excel file opening in your sample.
So, your sample works like a charm. I still have that problem copying and paste ig sample on local environment, but for sure there will be something to sort out in a different way, because the way I tried to solve it (first post) shows the meaning of the error.
Anyway, your sample is enough. I will start implementation basing on it.
Thank you very much!
FM