In the second link u have to add window.xlsx=xlsx then only it will work otherwise it will show error. where to add that is explained in this link- https://sfdcbro.com/2018/11/18/using-sheetjs-with-lightning-components/
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
In the second link u have to add window.xlsx=xlsx then only it will work otherwise it will show error. where to add that is explained in this link- https://sfdcbro.com/2018/11/18/using-sheetjs-with-lightning-components/
<aura:component implements="flexipage:availableForAllPageTypes" access="global"> <ltng:require scripts="{!$Resource.jszip}"/> //create a static resource with name jszip <ltng:require scripts="{!$Resource.XLSX}"/> //create another static resource with name XLSX
Hi anas, I want to fetch data from columns in salesforce into the lightning component. I want fetch colums that has annual revenue of each year of a corresponding account record. I want to fetch values from columns in excel to respective account record
To work on this we need to use two js files. i am providing the two js link files to download and store them as static resource in your org
https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/jszip.js
https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/xlsx.js
In the second link u have to add window.xlsx=xlsx then only it will work otherwise it will show error.
where to add that is explained in this link- https://sfdcbro.com/2018/11/18/using-sheetjs-with-lightning-components/
All Answers
Greetings to you!
Please refer to the below links which might help you further with the above requirement.
https://developer.salesforce.com/forums/?id=9062I000000g6eLQAQ
https://developer.salesforce.com/forums/?id=9060G0000005oFvQAI
https://blogs.absyz.com/2018/01/08/csv-parsing-and-generating-charts-in-lightning-components/
https://medium.com/@nando2904/custom-csv-dataloader-lightning-component-part-1-csv-input-aef6225d9d10
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thanks for reply, the links above u have sent those are for csv file reading i need to read excel (.xlsx) extension data.
Thanks and Regards
sai
https://github.com/4an70m/lightning-excel-import
https://sfdcbro.com/2018/11/18/using-sheetjs-with-lightning-components/
Regards,
Khan Anas
To work on this we need to use two js files. i am providing the two js link files to download and store them as static resource in your org
https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/jszip.js
https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/xlsx.js
In the second link u have to add window.xlsx=xlsx then only it will work otherwise it will show error.
where to add that is explained in this link- https://sfdcbro.com/2018/11/18/using-sheetjs-with-lightning-components/
<ltng:require scripts="{!$Resource.jszip}"/> //create a static resource with name jszip
<ltng:require scripts="{!$Resource.XLSX}"/> //create another static resource with name XLSX
<aura:attribute name="FileList" type="Object"/>
<lightning:input aura:id="file-input" type="file" files="{!v.FileList}" label="Files"
name="file" multiple="true" onchange="{!c.upload}"/>
</aura:component>
I want to fetch data from columns in salesforce into the lightning component. I want fetch colums that has annual revenue of each year of a corresponding account record. I want to fetch values from columns in excel to respective account record