Posted 5 September 2018, 10:32 am EST
I am using wijmo 5.20181.436. I am able to import excel files but could find how to drag and drop excel file on to FlexSheet. Is it possible?
Forums Home / Wijmo / General Discussion
Posted by: Gopala.Chintakindi on 5 September 2018, 10:32 am EST
Posted 5 September 2018, 10:32 am EST
I am using wijmo 5.20181.436. I am able to import excel files but could find how to drag and drop excel file on to FlexSheet. Is it possible?
Posted 5 September 2018, 10:34 am EST
This is for Angular 5 project using HTML and Typescript.
Posted 5 September 2018, 4:28 pm EST
Hi,
You may use UI drag/drop events to get the File instance and then use FlexSheet’s load() method to load the file.
Please refer to the following sample which implements the same:-
https://stackblitz.com/edit/angular-ds6d7q?file=app%2Fapp.component.ts
~Sharad
Posted 12 September 2018, 9:59 am EST - Updated 3 October 2022, 11:22 am EST
Thanks Sharad. The example looks promising. But one issue is it is deleting all my existing sheets. I mean if I have Country and Number sheets already in my FlexSheet. Country and Number sheets have data. After drag and drop, Country and Number sheets are deleted. Data is lost. Sheets in my excel file are added. This also happens in the example you showed me.
I need dragged files to be appended as new sheet(s) but not replace existing sheets. Please see below image
Posted 12 September 2018, 6:15 pm EST
Hi,
To append new sheets, you may first save the sheets before loading the excel file and then load saved sheets back after loading excel file.
Please refer to the following updated sample:
https://stackblitz.com/edit/angular-zncnu6?file=app%2Fapp.component.ts
~Sharad
Posted 13 September 2018, 3:40 am EST
Thank you very much. This is what I want.