cancel
Showing results for 
Search instead for 
Did you mean: 

Need to upload excle file when excel file is closed. If Excel file is Opened its should not allowed

vijay_kumar49
Active Contributor
0 Kudos

Hello Friends,

I am reading the data from excel using "FileUploader". its working fine. Now my requirement is if excel file is opened it should not allowed. when excel file is closed then only its will allowed. how to do this


<Label id="fileNameId" text="File Upload" required="true"/>

                           

<u:FileUploader id="fileUploader" name="FILENAME" placeholder="Upload your file to the SAP System"

                                    change="processFile" sameFilenameAllowed="false" liveChange="onSelectInput" width="350px"/>

Regards

Vijay

vijay_kumar49
Active Contributor
0 Kudos

Hello Friends,

Kindly help me, How to check weather excel is opened or not when browse the same excel file using fileUploader UI element.

Message was edited by: Vijay Kumar Kalluri

former_member494689
Participant
0 Kudos

Hi vijay.kumar49

Did you solve this issue?

Please kindly share the solution.

Best Regards,

Thiri

Accepted Solutions (0)

Answers (1)

Answers (1)

vijay_kumar49
Active Contributor
0 Kudos

Hi Zun,

Good day.

PFB Steps which is i implemented during that time.

1) Import "xlsx.js" into project and add that in manifest.json under resource.PFB screen shot for your reference.

2) Go to corresponding controller.js and View add below code.

View Code:
<Label id="fileNameId" text="File Upload" required="true"/>
<u:FileUploader id="fileUploader" name="FILENAME" placeholder="Upload your file to the SAP System" change="processFile" sameFilenameAllowed="false" liveChange="onSelectInput" width="350px"/>

Controller.JS

/*global location */
var tableModel; 
var X = XLSX; 
var view; 
var excelFileDatatable; 
var oExcelLineItems = []; 
var XW = { 
         /* worker message */ 
         msg: 'xlsx', 
        /* worker scripts */ 
        rABS: './xlsxworker2.js', 
        norABS: './xlsxworker1.js', 
        noxfer: './xlsxworker.js' 
};

You can write the "processFile" method code. PFA document.
export-excel-code.txt

Hope this should be help full for you.

Best Regards

Vijay

former_member494689
Participant
0 Kudos

Hi Vijay,

Thank you.

Noted. I will try it.

Best Regards,

Thiri