[英]How to create a report, as a Word document, from data in a Sharepoint list
I have a sharepoint list that is used to record weekly activity, eg four columns for weeknumber, projectname, customername, comment 我有一个用于记录每周活动的sharepoint列表,例如,周列数,项目名称,客户名称,评论的四列
I'd like to be able to generate a report containing all the data for a particular week in the following format 我希望能够以下列格式生成包含特定周的所有数据的报告
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. 我可以通过将列表导出到Excel文件然后编写一些VBA来生成Word文档来完成此操作,但我想知道是否有任何方法可以删除Excel步骤。
So there's two parts to this 所以这有两个部分
a) Getting the data from SharePoint. a)从SharePoint获取数据。
b) Converting it into a Word document. b)将其转换为Word文档。
For a) You will probably end up running this remotly (ie not on the sharePoint server) as automating office apps on a server is not recommended - so you should look into the SharePoint Web Services to access your data. 对于a)您可能最终运行此远程(即不在sharePoint服务器上),因为不建议在服务器上自动执行Office应用程序 - 因此您应该查看SharePoint Web服务以访问您的数据。
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 对于b)您可以使用 - Office Automation(通过VBA或C#,VB.NET等) - Pete建议的Open XML( 在SharePoint中运行的示例 ) - Apose等商业组件最后两个允许您运行代码SharePoint服务器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.