6

I have a requirement where I need to upload the excel file, parse it and store in documents. I know uploading csv and parsing but the requirment is with excel upload. Anybody done this previously? or any kind of work around?

8

Excel files are tricky, depending on the version of Office used, if your users are using the latest version (.xlsx), you can access the contents, however if it is the older format (.xls) this is a binary format and is not parseable by Apex. Check out this blog and approach on how to upload an .xlsx file and access its contents (which are mostly XML files). The basic idea is this...

<c:unzipfile name="somezipfile" oncomplete="unzipped(state);"
  onreceive="{!$RemoteAction.UnzipDemoController.receiveZipFileEntry}" />

Then to handle the contents of the XLXS file an Apex method is defined as follows...

@RemoteAction
public static String receiveZipFileEntry(String filename, String path, String data, String state)

This is a screenshot from the blog thats shows what you can do...

enter image description here

1
  • Always thought it would be difficult. Thanks for the link. – Ganesh Bhosle Dec 10 '13 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.