I have a client of my web based application who heavily uses the data from our system for powerpoint presentations.
我有一个基于Web的应用程序的客户端,他们大量使用我们系统中的数据进行powerpoint演示。
We currently allow data to export in more traditional file types...PDF, CSV, HTML, and a few others. Powerpoint doesn't seem to be really automated.
我们目前允许以更传统的文件类型导出数据... PDF,CSV,HTML和其他一些文件类型。 Powerpoint似乎并没有真正实现自动化。
Is there a way, on the ASP.NET server side, to automate the creation and on-demand download of a powerpoint file format for a report from a system?
在ASP.NET服务器端,是否有办法自动为系统报告创建和按需下载powerpoint文件格式?
6 个解决方案
#1
4
In this article, Steve suggests using Aspose's Slide application.
在本文中,Steve建议使用Aspose的Slide应用程序。
He also explains step by step on how to generate the PowerPoint file.
他还逐步解释了如何生成PowerPoint文件。
Here are some code excerpts (in VB):
以下是一些代码摘录(在VB中):
Opening an existing PowerPoint file:
打开现有的PowerPoint文件:
Dim fs As System.IO.FileStream = _
New System.IO.FileStream("c:\mypath\myfile.ppt", _
System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim MyPres As Presentation = New Presentation(fs)
fs.Close()
Looping the slides and outputting their template formats:
循环幻灯片并输出其模板格式:
Dim slides As Slides = MyPres.Slides
For i As Integer = 0 To slides.Count - 1
Response.Write(MyPres.Slides(i).Layout.ToString + "<br>")
Next
In his article, he describes more in detail on how to do it.
在他的文章中,他详细描述了如何做到这一点。
#2
7
There's some documentation on MSDN about the OpenXML format that they're using:
MSDN上有一些关于他们正在使用的OpenXML格式的文档:
- Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 1 of 2)
- 使用Open XML Format API处理Excel 2007和PowerPoint 2007文件(第1部分,共2部分)
- Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 2 of 2)
- 使用Open XML Format API处理Excel 2007和PowerPoint 2007文件(第2部分,共2部分)
#3
4
Well you have two ways of really doing this, without third party tools. The first would be with Automation of PowerPoint, but that requires that your server have PowerPoint installed. The second is to utilize the new pptx file file format and generate the powerpoint document using XML.
那么你有两种方法可以做到这一点,没有第三方工具。第一个是使用PowerPoint自动化,但这要求您的服务器安装了PowerPoint。第二种是利用新的pptx文件文件格式并使用XML生成powerpoint文档。
I have found that the best way to get started on the XML side is to simply create a powerpoint that does what you want, then save it and look at the XML. You can also review the microsoft documentation. Overall working with the XML formats is pretty easy.
我发现开始使用XML的最佳方法是简单地创建一个能够满足您需求的powerpoint,然后保存它并查看XML。您还可以查看microsoft文档。整体使用XML格式非常简单。
Lastly, there might be some third party items out there, but be careful that they don't require COM automation.
最后,可能会有一些第三方项目,但要小心它们不需要COM自动化。
#4
4
In regards to the previous poster, your statement is incorrect.
关于上一张海报,您的陈述不正确。
You really only have one option for server side ASP.NET automation of this process. Use the open xml links mentioned by Ben in the original answer...
实际上,此进程的服务器端ASP.NET自动化只有一个选项。使用Ben在原始答案中提到的开放xml链接...
Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 1 of 2) Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 2 of 2)
使用Open XML格式API处理Excel 2007和PowerPoint 2007文件(第1部分,共2部分)使用Open XML格式API处理Excel 2007和PowerPoint 2007文件(第2部分,共2部分)
The reason for this is that server side automation of office is completely unsupported and is bad coding practise, running com automation servers that are designed for interactive usage in a non-interactive environment is a potential recipe for disaster.
这样做的原因是办公室的服务器端自动化完全不受支持并且是错误的编码实践,运行为非交互式环境中的交互式使用而设计的com自动化服务器是潜在的灾难。
so in summary use the open xml api and generate your pptx's.
所以总结一下使用open xml api并生成你的pptx。
#5
0
There are also other third-party options similar to Aspose Slides, such as OfficeWriter's PowerPoint Writer.
还有其他类似于Aspose幻灯片的第三方选项,例如OfficeWriter的PowerPoint Writer。
I'm not exactly sure how Aspose Slides works, but with PowerPoint Writer you have an existing, formatted PowerPoint presentation with data markers in it, the you process it with PowerPoint Writer to replace the data markers with data. Here are some examples.
我不确定Aspose Slides是如何工作的,但是使用PowerPoint Writer,你有一个带有数据标记的现有格式化PowerPoint演示文稿,你用PowerPoint Writer处理它以用数据替换数据标记。这里有些例子。
#6
-1
there is another method ,convert your power point presentation to images or xps(silver light presentation) and then use some sort of json(jquery) to show and download them.
还有另一种方法,将你的电源点演示转换为图像或xps(银灯演示),然后使用某种json(jquery)来显示和下载它们。
i implement the images and xps silver light presentation in my web application
我在我的Web应用程序中实现图像和xps银灯演示
#1
4
In this article, Steve suggests using Aspose's Slide application.
在本文中,Steve建议使用Aspose的Slide应用程序。
He also explains step by step on how to generate the PowerPoint file.
他还逐步解释了如何生成PowerPoint文件。
Here are some code excerpts (in VB):
以下是一些代码摘录(在VB中):
Opening an existing PowerPoint file:
打开现有的PowerPoint文件:
Dim fs As System.IO.FileStream = _
New System.IO.FileStream("c:\mypath\myfile.ppt", _
System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim MyPres As Presentation = New Presentation(fs)
fs.Close()
Looping the slides and outputting their template formats:
循环幻灯片并输出其模板格式:
Dim slides As Slides = MyPres.Slides
For i As Integer = 0 To slides.Count - 1
Response.Write(MyPres.Slides(i).Layout.ToString + "<br>")
Next
In his article, he describes more in detail on how to do it.
在他的文章中,他详细描述了如何做到这一点。
#2
7
There's some documentation on MSDN about the OpenXML format that they're using:
MSDN上有一些关于他们正在使用的OpenXML格式的文档:
- Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 1 of 2)
- 使用Open XML Format API处理Excel 2007和PowerPoint 2007文件(第1部分,共2部分)
- Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 2 of 2)
- 使用Open XML Format API处理Excel 2007和PowerPoint 2007文件(第2部分,共2部分)
#3
4
Well you have two ways of really doing this, without third party tools. The first would be with Automation of PowerPoint, but that requires that your server have PowerPoint installed. The second is to utilize the new pptx file file format and generate the powerpoint document using XML.
那么你有两种方法可以做到这一点,没有第三方工具。第一个是使用PowerPoint自动化,但这要求您的服务器安装了PowerPoint。第二种是利用新的pptx文件文件格式并使用XML生成powerpoint文档。
I have found that the best way to get started on the XML side is to simply create a powerpoint that does what you want, then save it and look at the XML. You can also review the microsoft documentation. Overall working with the XML formats is pretty easy.
我发现开始使用XML的最佳方法是简单地创建一个能够满足您需求的powerpoint,然后保存它并查看XML。您还可以查看microsoft文档。整体使用XML格式非常简单。
Lastly, there might be some third party items out there, but be careful that they don't require COM automation.
最后,可能会有一些第三方项目,但要小心它们不需要COM自动化。
#4
4
In regards to the previous poster, your statement is incorrect.
关于上一张海报,您的陈述不正确。
You really only have one option for server side ASP.NET automation of this process. Use the open xml links mentioned by Ben in the original answer...
实际上,此进程的服务器端ASP.NET自动化只有一个选项。使用Ben在原始答案中提到的开放xml链接...
Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 1 of 2) Manipulating Excel 2007 and PowerPoint 2007 Files with the Open XML Format API (Part 2 of 2)
使用Open XML格式API处理Excel 2007和PowerPoint 2007文件(第1部分,共2部分)使用Open XML格式API处理Excel 2007和PowerPoint 2007文件(第2部分,共2部分)
The reason for this is that server side automation of office is completely unsupported and is bad coding practise, running com automation servers that are designed for interactive usage in a non-interactive environment is a potential recipe for disaster.
这样做的原因是办公室的服务器端自动化完全不受支持并且是错误的编码实践,运行为非交互式环境中的交互式使用而设计的com自动化服务器是潜在的灾难。
so in summary use the open xml api and generate your pptx's.
所以总结一下使用open xml api并生成你的pptx。
#5
0
There are also other third-party options similar to Aspose Slides, such as OfficeWriter's PowerPoint Writer.
还有其他类似于Aspose幻灯片的第三方选项,例如OfficeWriter的PowerPoint Writer。
I'm not exactly sure how Aspose Slides works, but with PowerPoint Writer you have an existing, formatted PowerPoint presentation with data markers in it, the you process it with PowerPoint Writer to replace the data markers with data. Here are some examples.
我不确定Aspose Slides是如何工作的,但是使用PowerPoint Writer,你有一个带有数据标记的现有格式化PowerPoint演示文稿,你用PowerPoint Writer处理它以用数据替换数据标记。这里有些例子。
#6
-1
there is another method ,convert your power point presentation to images or xps(silver light presentation) and then use some sort of json(jquery) to show and download them.
还有另一种方法,将你的电源点演示转换为图像或xps(银灯演示),然后使用某种json(jquery)来显示和下载它们。
i implement the images and xps silver light presentation in my web application
我在我的Web应用程序中实现图像和xps银灯演示