Description |
---|
...
Wiki Markup |
---|
{description} {excerpt}Generates an Excel binary file and streams it to the specified {msdn:System.IO.Stream |
...
|System.IO.Stream |
...
} or, a class derived from {{System.IO.Stream}} \(for example, |
...
{msdn |
...
:System.IO.FileStream |
...
|System.IO.FileStream |
...
}\). If you pass [Save|ExcelTemplate.Save] a {{System.IO.FileStream}}, ExcelWriter will save the generated file on the server. If you pass {{Save}} {{Response.OutputStream}}, ExcelWriter will stream the the generated file to the client. |
...
Signature | ||
---|---|---|
C# | C# | {excerpt}
{signature:C#}
public virtual void Save(System.IO.Stream stream)
|
Signature | ||
{signature}{signature:vb.net | vb.net | }
Public Overridable Sub Save(ByVal stream As System.IO.Stream)
|
Parameters |
---|
Param | ||
---|---|---|
outputStream | outputStream | A {signature} {parameters} {param:outputStream}A {{System.IO.Stream}} object \(for example, {{Response.OutputStream}}\) or, a class derived from {{System.IO.Stream}} \(for example, {{System.IO.FileStream) |
Exceptions |
---|
Exception | ||
---|---|---|
ArgumentNullException | ArgumentNullException | Save will throw this exception if null (C#) or Nothing }}\){param} {exceptions} {exception:ArgumentNullException}{{Save}} will throw this exception if {{null}} \(C\#\) or {{Nothing}} \(VB.NET\) is passed to the method. |
Exception | ArgumentException | ArgumentException |
Remarks |
---|
ExcelWriter allows you to save in both the Excel 97-03 BIFF8 format (.xls) or the new Office Open XML (.xlsx) format. The template file must be of the expected output format. Hence, if you wish to output .xls files, you must start with a .xls template, and if you wish to output .xlsx files, you must start with a .xlsx template. ExcelWriter does not support the creation or editing of .xlsx files with the ExcelApplication object. You can call |
Example | |||
---|---|---|---|
Code Block | | csharp | csharp |
title | C# | ||
Code Block | vb.net | title |