asp.net - 即时生成Powerpoint文件

pea*_*ewg 11 asp.net powerpoint reporting report

我有一个基于Web的应用程序的客户端,他们大量使用我们系统中的数据进行powerpoint演示.

我们目前允许以更传统的文件类型导出数据... PDF,CSV,HTML和其他一些文件类型.Powerpoint似乎并没有真正实现自动化.

在ASP.NET服务器端,是否有办法自动为系统中的报告创建和按需下载powerpoint文件格式?

And*_*ech 4

在本文中,Steve 建议使用 Aspose 的 Slide 应用程序。

他还逐步解释了如何生成 PowerPoint 文件。

以下是一些代码摘录(VB 语言):

打开现有的 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() 
Run Code Online (Sandbox Code Playgroud)

循环幻灯片并输出其模板格式:

Dim slides  As Slides = MyPres.Slides

For i As Integer = 0 To slides.Count - 1

   Response.Write(MyPres.Slides(i).Layout.ToString + "<br>")

Next
Run Code Online (Sandbox Code Playgroud)

在他的文章中,他更详细地描述了如何做到这一点。