Back to Devexpress

SpreadsheetBuilder.Open(String, DocumentFormat) Method

aspnetcore-devexpress-dot-aspnetcore-dot-spreadsheet-dot-spreadsheetbuilder-dot-open-x28-system-dot-string-devexpress-dot-spreadsheet-dot-documentformat-x29.md

latest2.1 KB
Original Source

SpreadsheetBuilder.Open(String, DocumentFormat) Method

Opens a document in the specified format from a file system.

Namespace : DevExpress.AspNetCore.Spreadsheet

Assembly : DevExpress.AspNetCore.Spreadsheet.v25.2.dll

NuGet Package : DevExpress.AspNetCore.Spreadsheet

Declaration

csharp
public SpreadsheetBuilder Open(
    string path,
    DocumentFormat documentFormat
)

Parameters

NameTypeDescription
pathString

A document path.

| | documentFormat | DocumentFormat |

A document format.

|

Returns

TypeDescription
SpreadsheetBuilder

An object that can be used to further configure the Spreadsheet.

|

Remarks

This method overload allows you to disable automatic format detection and improve performance when the Spreadsheet opens a document. Call the Open(String) method to determine the document’s format automatically when you open a document.

The example below demonstrates how to open a document from a file system:

razor
@(Html.DevExpress()
    .Spreadsheet("spreadsheet")
    .Open("path-to-your-document", DocumentFormat.Xlsx)
)

Refer to the following section for more information: Open a Document from a File System.

See Also

SpreadsheetBuilder Class

SpreadsheetBuilder Members

DevExpress.AspNetCore.Spreadsheet Namespace