Back to Devexpress

XlDocumentView Class

corelibraries-devexpress-dot-export-dot-xl-9680e8d4.md

latest2.8 KB
Original Source

XlDocumentView Class

Contains display options for the workbook.

Namespace : DevExpress.Export.Xl

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public class XlDocumentView
vb
Public Class XlDocumentView

The following members return XlDocumentView objects:

Remarks

Use the XlDocumentView class options to specify the workbook’s display options. These options are in effect when the document is saved and opened in Microsoft Excel.

The code sample below shows how to specify the XlDocumentView options:

csharp
IXlExporter exporter = XlExport.CreateExporter(XlDocumentFormat.Xlsx);

// Create the FileStream object with the specified file path. 
using (FileStream stream = new FileStream("Document.xlsx", FileMode.Create, FileAccess.ReadWrite))
{
  // Create a new document and write it to the specified stream.
  using (IXlDocument document = exporter.CreateDocument(stream))
  {
      // Specify the document culture.
      document.Options.Culture = CultureInfo.CurrentCulture;

      //Specify display options for the created document.
      XlDocumentView workbookView = document.View;
      workbookView.GroupDatesInAutoFilterMenu = true;
      workbookView.SelectedTabIndex = 1;
      workbookView.ShowSheetTabs = false;
      workbookView.ShowVerticalScrollBar = false;
  }
}
vb
Dim exporter As IXlExporter = XlExport.CreateExporter(XlDocumentFormat.Xlsx)

' Create the FileStream object with the specified file path. 
Using stream As New FileStream("Document.xlsx", FileMode.Create, FileAccess.ReadWrite)
  ' Create a new document and write it to the specified stream.
  Using document As IXlDocument = exporter.CreateDocument(stream)
    ' Specify the document culture.
    document.Options.Culture = CultureInfo.CurrentCulture

    'Specify display options for the created document.
    Dim workbookView As XlDocumentView = document.View
    workbookView.GroupDatesInAutoFilterMenu = True
    workbookView.SelectedTabIndex = 1
    workbookView.ShowSheetTabs = False
    workbookView.ShowVerticalScrollBar = False
  End Using
End Using

Inheritance

Object XlDocumentView

See Also

XlDocumentView Members

DevExpress.Export.Xl Namespace