aspnetmvc-devexpress-dot-web-dot-mvc-dot-spreadsheetextension-dot-getcurrentdocument-x28-system-dot-string-x29.md
Gets access to a workbook loaded into the specified Spreadsheet.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public static IWorkbook GetCurrentDocument(
string extensionName
)
Public Shared Function GetCurrentDocument(
extensionName As String
) As IWorkbook
| Name | Type | Description |
|---|---|---|
| extensionName | String |
A string value specifying the Spreadsheet name.
|
| Type | Description |
|---|---|
| IWorkbook |
A IWorkbook interface specifying a document loaded in the Spreadsheet.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetCurrentDocument(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
asp-net-mvc-spreadsheet-modify-document/CS/DXWebApplication1/Controllers/HomeController.cs#L24
public ActionResult CustomAction(string customCommand) {
IWorkbook workbook = SpreadsheetExtension.GetCurrentDocument("Spreadsheet");
Worksheet worksheet = workbook.Worksheets[0];
public ActionResult ValidateSpreadsheet(object Spreadsheet) {
IWorkbook myWorkBook = SpreadsheetExtension.GetCurrentDocument("Spreadsheet");
int test = Convert.ToInt32(myWorkBook.Worksheets[0].Cells["B3"].Value.NumericValue);
asp-net-mvc-spreadsheet-modify-document/VB/DXWebApplication1/Controllers/HomeController.vb#L17
Public Function CustomAction(ByVal customCommand As String) As ActionResult
Dim workbook As IWorkbook = SpreadsheetExtension.GetCurrentDocument("Spreadsheet")
Dim worksheet As Worksheet = workbook.Worksheets(0)
Public Function ValidateSpreadsheet(ByVal Spreadsheet As Object) As ActionResult
Dim myWorkBook As IWorkbook = SpreadsheetExtension.GetCurrentDocument("Spreadsheet")
Dim test As Integer = Convert.ToInt32(myWorkBook.Worksheets(0).Cells("B3").Value.NumericValue)
See Also