Cómo crear un informe, como un documento de Word, a partir de datos en una lista de Sharepoint

I have a sharepoint list that is used to record weekly activity, e.g. four columns for weeknumber, projectname, customername, comment

I'd like to be able to generate a report containing all the data for a particular week in the following format

  • ProjectName 1
    • Cliente 1
      • Opina 1
    • Cliente 2
      • Opina 1
  • ProjectName 2
    • Cliente 3
      • Opina 1
    • Cliente 4
      • Opina 1

I can do this by exporting the list to an Excel file and then writing some VBA to generate a Word Document, but I'm wondering if there is any way to cut out the Excel step.

preguntado el 12 de junio de 12 a las 17:06

3 Respuestas

Abrir XML ?

I found it quite a steep learning curve to get into, but very powerful. I'd suggest that this is a more elegant approach than vba (in that you are dealing with strongly-typed classes) but not necessarily quicker.

Respondido el 12 de junio de 12 a las 17:06

So there's two parts to this

a) Getting the data from SharePoint.

b) Converting it into a Word document.

For a) You will probably end up running this remotly (i.e. not on the sharePoint server) as automating office apps on a server is not recommended - so you should look into the Servicios web de SharePoint para acceder a sus datos.

For b) You can use - Office Automation (via VBA or C#, VB.NET etc) - Open XML as Pete suggests (Example running in SharePoint) - A commercial component such as Apose The last two will allow you to run your code on the SharePoint server

Respondido el 13 de junio de 12 a las 08:06

There is nice example on Github (FoodOrder) on how to do it with Templater.

As author I highly recommend it ;)

Respondido el 19 de junio de 12 a las 18:06

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.