-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathExportActions.cs
32 lines (26 loc) · 1009 Bytes
/
ExportActions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using DevExpress.Spreadsheet;
using DevExpress.XtraSpreadsheet.Export;
using System.IO;
namespace SpreadsheetDocServerAPIPart2
{
public static class ExportActions
{
private static void ExportDocToHTML(Workbook workbook)
{
#region #ExportToHTML
Worksheet worksheet = workbook.Worksheets["Grouping"];
workbook.Worksheets.ActiveWorksheet = worksheet;
HtmlDocumentExporterOptions options = new HtmlDocumentExporterOptions();
// Specify the cell range you want to save as HTML.
options.SheetIndex = worksheet.Index;
options.Range = "B2:G7";
// Export data to HTML format.
using (FileStream htmlStream = new FileStream("OutputWorksheet.html", FileMode.Create))
{
workbook.ExportToHtml(htmlStream, options);
}
System.Diagnostics.Process.Start("OutputWorksheet.html");
#endregion #ExportToHTML
}
}
}