Description
Streams the PowerPointTemplate to the client. This method allows you to specify a default client-side file name, and whether the file should be opened in the browser window or in Microsoft PowerPoint
Parameters
response
An HttpResponse to write the resulting PowerPoint file to.attachmentName
Specifies a name for the generated Excel file; this name will be displayed in the download dialog when the file is streamed to the browser.openInBrowser
If openInBrowser
is set to true
, and the user chooses to open the file, the file will open in the browser window. If openInBrowser
is set to false
, and the user chooses to open the file, the file will open in Microsoft Excel. By default, the file will open in the browser window.
Exceptions
InvalidOperationException
Save
will throw this exception if it does not have a PowerPoint document handle (Save
cannot be called before Open
).
Remarks
You can callSave
more than once for a single instance of PowerPointTemplate. This allows you to save more than one copy of a generated file, and/or both save the file on the server and stream it to the client.
Examples
Stream to the client and open in PowerPoint
When you pass an HttpResponse object to Save
, PowerPointWriter will stream the generated PowerPoint file to the client. The browser will display a File Download dialog asking the user to open or save the file. The method's second parameter specifies a file name to display in the File Download dialog. If the method's third parameter - openInBrowser - is false
and the user chooses to open the Excel file, the file will open in Microsoft PowerPoint.
Stream to the client and open in the browser window
When you pass an HttpResponse object to Save
, PowerPointWriter will stream the generated PowerPoint file to the client. The browser will display a File Download dialog asking the user to open or save the file. The method's second parameter specifies a file name to display in the File Download dialog. If the method's third parameter - openInBrowser - is True and the user chooses to open the PowerPoint file, the file will open in the browser window.