0

I have a requirement that requires generation of an Excel document programmatically in SharePoint. I need to use an Excel template that has labels like

Name:
Designation:
Email:

I have a list with the same columns. I need to fetch data from this list and populate instances of the aforesaid template and save it.

Name : XYZ 
Designation : ABC
Email : 1@a.com

This has to be done programmatically. Any idea how I do it?

0

So what did you write so far? You could write a solution and let it run maybe on item-created or whatever kind of occurence you want it to happen. Then you need a Excel-Library (Aspose etc.) to create an Excel File. In the SPContext you are able to get List-Items and so you can write them to a Excel-File.

  • I can create a excel sheet from scratch and save it just fine. I want to use a preexisting excel sheet, probably stored in a library. Populate a copy of it with list items and save it. That would reduce a lot of unnecessary overheads.... – Swayam Siddha May 26 '14 at 10:01
  • maybe you want to use this code fragment: sharepointwithattitude.com/archives/61 then you could open the document, edit it and then save it in a different location. – Gwny May 26 '14 at 10:11
  • Thanks, I am able to retrieve the excel. All I need to do now is to copy it to another library and populate it :) – Swayam Siddha May 26 '14 at 12:23

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.