I am using Kendo UI for Angular and trying to do a multi-grid export per the instructions given at
https://www.telerik.com/kendo-angular-ui/components/excelexport/how-to/export-to-separate-sheets/
I would like to present a "waiting" indicator to the user until the report is actually downloaded.
The problem is that:
this.gridElements.first.kendoExcelElement.save(workbooks[0]);
returns immediately, and I don't know of a way to monitor the status of the download to detect once it has finished. Any tips for how I can detect finish?
Here is the code for the export:
this.loaded = false;
//Multi-export method outlined at: https://www.telerik.com/kendo-angular-ui/components/excelexport/how-to/export-to-separate-sheets/
Promise.all(elementsWithData.map(c => c.kendoExcelElement.workbookOptions())).then((workbooks) => {
//Set the name on the parent workbook/sheet
workbooks.forEach((w, index) => {
//Don't add the first workbook since that would result in duplicate sheets based on the fact
//that the first workbook is the one being concatenated too...
if(index > 0) {
workbooks[0].sheets = workbooks[0].sheets.concat(w.sheets);
}
});
//our problem is that this save call does not wait, and does not return a promise to hold on...
this.gridElements.first.kendoExcelElement.save(workbooks[0]);
}).catch(e => console.log(e))
.finally(() => this.loaded = true);
Thanks!