-
Notifications
You must be signed in to change notification settings - Fork 5
/
ExportActions.cs
31 lines (28 loc) · 902 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
using System;
using System.IO;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Collections.Generic;
using DevExpress.Spreadsheet;
namespace SpreadsheetExamples
{
public static class ExportActions
{
#region Actions
public static Action<Workbook> ExportToPdfAction = ExportToPdf;
#endregion
static void ExportToPdf(Workbook workbook)
{
workbook.Worksheets[0].Cells["D8"].Value = "This document is exported to the PDF format.";
#region #ExportToPdf
// Export the workbook to PDF.
using (FileStream pdfFileStream = new FileStream("Documents\\Document_PDF.pdf", FileMode.Create))
{
workbook.ExportToPdf(pdfFileStream);
}
#endregion #ExportToPdf
Process.Start("Documents\\Document_PDF.pdf");
}
}
}