Skip to main content
All docs
V25.1
  • IXlDocument.View Property

    Provides access to the view options of the workbook.

    Namespace: DevExpress.Export.Xl

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

    NuGet Package: DevExpress.Printing.Core

    Declaration

    XlDocumentView View { get; }

    Property Value

    Type Description
    XlDocumentView

    An object that contains view options.

    Remarks

    Use the View property to access and 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:

    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;
      }
    }
    
    See Also