When using the ExportExcelButton, from the OutsystemsDataGridWeb forge component it just locks the datagrid and errors out in console.WijmoJS.js?632256:14 Uncaught ** Assertion failed in Wijmo: Please use JSZip 2.5 to save excel files synchronously. ErrorTheres a barebones oml attached that showcases the issue.
Hi David,
I ran into the same problem, but with the reactive version. The error occurred because I was still using the save() method for Excel export.
The documentation notes that save() works with JSZip 2.5, while saveAsync() requires JSZip 3.0.
By default OS uses JSZip 3.10.1.
As a workaround you can replace the version of the JSZip. In the screen's javascript property paste the following script:
// 1. Remove the platform’s JSZip 3.x
delete window.JSZip;
// 2. Dynamically load JSZip 2.5.0
(function() {
var jszip = document.createElement('script');
jszip.type = 'text/javascript';
jszip.src = 'https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js';
document.getElementsByTagName('head')[0].appendChild(jszip);
})();
You can also check the updated OML I uploaded.
Hello @David Queimado
This is a known issue well explained by @Mihai Melencu and will be fixed in the next release under code ROU-12042 (for release notes reference).
Cheers,GM
Hi Gonçalo,
There are two more versions released with the same issue and without a known-issue note. Is there a plan to fix it in the next release?
Can you share a sample with the steps to reproduce using the latest version?
In the right-click Menu the application uses the normal ...features.export.exportToExcel() function which works correctly and uses the default JSZip 3.10.1
But for custom export we use wijmo.grid.xlsx.FlexGridXlsxConverter.save(this._grid.provider, params) function and it does not work with JSZip 3.10.1 and requires JSZip 2.5.0
Could you share a sample oml where weccan reproduced that I would appreciate it?
Please find the OML attached. I have reproduced the current implementation. The Excel export customisation JS node is inside the OnInitialize_Grid action
seems like you are js expert @Mihai Melencu :), appreciate your help on many topics
Hi @Viktar Ramaneika
After looking at your oml, I managed to identify some inconsistencies:
Hi @Gonçalo Martins
Thank you for the detailed response. I used this post because a proper discussion had already started here, and Mihail mentioned: “I ran into the same problem, but with the reactive version”
Thank you for the resolution recommendation. I will replace the function
Sorry for the incorrect statement. It would be good to mention this update as a potentially breaking change in the release notes:
We think the release note has all the information needed, and that makes sense for the product (this isn't something that should be on the release, but we're already aware of some scenarios where we want to provide awareness). Custom code done by the developers is not supported, so it is not considered a breaking change on the product since it's the developer's responsibility to maintain it.
Cheers
Thanks, that worked