[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Collapse]API Reference
  [Expand]DevExpress.BarCodes
  [Expand]DevExpress.Compression
  [Expand]DevExpress.Docs.Text
  [Expand]DevExpress.Office
  [Expand]DevExpress.Office.Drawing
  [Expand]DevExpress.Office.Export
  [Expand]DevExpress.Office.Export.Html
  [Expand]DevExpress.Office.Import
  [Expand]DevExpress.Office.Localization
  [Expand]DevExpress.Office.Options
  [Expand]DevExpress.Office.Services
  [Expand]DevExpress.Office.Utils
  [Expand]DevExpress.Pdf
  [Expand]DevExpress.Pdf.Localization
  [Expand]DevExpress.Snap
  [Expand]DevExpress.Spreadsheet
  [Expand]DevExpress.Spreadsheet.Charts
  [Expand]DevExpress.Spreadsheet.Drawings
  [Expand]DevExpress.Spreadsheet.Export
  [Expand]DevExpress.Spreadsheet.Formulas
  [Expand]DevExpress.Spreadsheet.Functions
  [Expand]DevExpress.UnitConversion
  [Expand]DevExpress.XtraPrinting
  [Expand]DevExpress.XtraPrintingLinks
  [Expand]DevExpress.XtraRichEdit
  [Expand]DevExpress.XtraRichEdit.API.Layout
  [Expand]DevExpress.XtraRichEdit.API.Native
  [Expand]DevExpress.XtraRichEdit.API.Native.Implementation
  [Expand]DevExpress.XtraRichEdit.Commands
  [Expand]DevExpress.XtraRichEdit.Export
  [Expand]DevExpress.XtraRichEdit.Export.Html
  [Expand]DevExpress.XtraRichEdit.Export.PlainText
  [Expand]DevExpress.XtraRichEdit.Export.Rtf
  [Expand]DevExpress.XtraRichEdit.Forms
  [Expand]DevExpress.XtraRichEdit.Import
  [Expand]DevExpress.XtraRichEdit.Localization
  [Expand]DevExpress.XtraRichEdit.Services
  [Expand]DevExpress.XtraRichEdit.Utils
  [Expand]DevExpress.XtraSpreadsheet
  [Expand]DevExpress.XtraSpreadsheet.Export
  [Expand]DevExpress.XtraSpreadsheet.Export.Html
  [Expand]DevExpress.XtraSpreadsheet.Import
  [Expand]DevExpress.XtraSpreadsheet.Localization
  [Collapse]DevExpress.XtraSpreadsheet.Services
    DefinedNameStatus Enumeration
   [Expand]ICustomAssemblyLoadingNotificationService Interface
   [Expand]ICustomCalculationService Interface
   [Expand]IDefinedNameValidator Interface
   [Collapse]IFormatDetectorService Interface
     IFormatDetectorService Members
    [Expand]IFormatDetectorService Methods
   [Expand]IMessageBoxService Interface
   [Expand]IObjectDataSourceValidationService Interface
   [Expand]ISpreadsheetCommandFactoryService Interface
   [Expand]SpreadsheetCommandFactoryServiceWrapper Class
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

IFormatDetectorService Interface

Allows detecting the format of a document contained in a stream.

Namespace:DevExpress.XtraSpreadsheet.Services
Assembly:DevExpress.Spreadsheet.v19.1.Core.dll

Expanded Syntax

Expanded Remarks

The built-in IFormatDetectorService service implementation detects the format of the document loaded from a stream using the DevExpress.Xpf.Spreadsheet.SpreadsheetControl.DocumentSource property or one of the LoadDocument method overloads.

The table below lists all formats the service can detect and gives information about elements which are used to indicate the format.

Format Detected by
XLSX, XLSM, XLTX, XLTM Inner zip archive signature and the contents of the [Content_Types].xml file.
XLS, XLT (including Excel 97 - Excel 2003 (BIFF8) and 5.0/95(BIFF5) Binary file formats) Compound File Binary signature and the Workbook or Book stream availability in the CFB file.
CSV, TXT (only if loaded from a System.IO.FileStream instance) Document file extension.
Important

The format of an encrypted XLSX/XLSM/XLTX/XLTM file cannot be detected (the DocumentFormat.Undefined value is returned).

If the IFormatDetectorService instance fails to detect the format, an InvalidFormatException exception is thrown.

You can implement your own format detector and register it as a service to use in your application.

Expanded Example

Expanded Inheritance Hierarchy

Expanded See Also

Is this topic helpful?​​​​​​​