corelibraries-devexpress-dot-xtraprinting-dot-xlsexportoptions.md
Specifies whether the document should be exported to a single or different XLS files, each page in a separate file.
Namespace : DevExpress.XtraPrinting
Assembly : DevExpress.Printing.v25.2.Core.dll
NuGet Package : DevExpress.Printing.Core
[DefaultValue(XlsExportMode.SingleFile)]
public XlsExportMode ExportMode { get; set; }
<DefaultValue(XlsExportMode.SingleFile)>
Public Property ExportMode As XlsExportMode
| Type | Default | Description |
|---|---|---|
| XlsExportMode | SingleFile |
An XlsExportMode enumeration value.
|
Available values:
| Name | Description |
|---|---|
| SingleFile |
A document is exported to a single file. Note that in this mode, page headers and footers are added to the resulting XLS file only once, at the beginning and at the end of the document.
| | SingleFilePageByPage |
A document is exported to a single file, page-by-page. In this mode, each page is exported to an individual sheet of the same XLS file.
| | DifferentFiles |
A document is exported to multiple files, page-by-page. In this mode every document page is exported to a single XLS file.
|
You can access this nested property as listed below:
| Object Type | Path to ExportMode |
|---|---|
| ExportOptions |
.Xls .ExportMode
|
The code below demonstrates to export a report to XLS with the specific export options.
using DevExpress.XtraPrinting;
//...
public partial class Form1 : Form {
//...
private void button1_Click(object sender, EventArgs e) {
// A path to export a report.
string reportPath = "c:\\Test.xls";
// Create a report instance.
XtraReport1 report = new XtraReport1();
// Get its XLS export options.
XlsExportOptions xlsOptions = report.ExportOptions.Xls;
// Set XLS-specific export options.
xlsOptions.ShowGridLines = true;
xlsOptions.TextExportMode = TextExportMode.Value;
xlsOptions.ExportHyperlinks = true;
xlsOptions.SheetName = "My Sheet";
xlsOptions.ExportMode = XlsExportMode.DifferentFiles;
// Export the report to XLS.
report.ExportToXls(reportPath);
//...
}
//...
Imports DevExpress.XtraPrinting
'...
Partial Public Class Form1
Inherits Form
'...
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
' A path to export a report.
Dim reportPath As String = "c:\Test.xls"
' Create a report instance.
Dim report As New XtraReport1()
' Get its XLS export options.
Dim xlsOptions As XlsExportOptions = report.ExportOptions.Xls
' Set XLS-specific export options.
xlsOptions.ShowGridLines = True
xlsOptions.TextExportMode = TextExportMode.Value
xlsOptions.ExportHyperlinks = True
xlsOptions.SheetName = "My Sheet"
xlsOptions.ExportMode = XlsExportMode.DifferentFiles
' Export the report to XLS.
report.ExportToXls(reportPath)
'...
End Sub
'...
See Also