Your search did not match any results.

Open a File

Backend API
@inject IHostingEnvironment env <div class="button-container"> <div id="button-save"></div> </div> <script type="text/javascript"> $("#button-save").dxButton({ icon: "save", type: "normal", text: "Save copy to file", onClick: function (e) { var spreadsheetState = spreadsheet.getSpreadsheetState(); $.ajax({ type: 'POST', url: '@Url.Action("SaveToFile")', data: { spreadsheetState: spreadsheetState } }); } }); </script> @{ var documentPath = System.IO.Path.Combine( env.ContentRootPath, DirectoryManagmentUtils.GetDocumentSampleFolderPath(Context), "EmployeeInformation.xlsx"); } @(Html.DevExpress() .Spreadsheet("spreadsheet") .Height("500px") .Width("100%") .ConfirmOnLosingChanges(confirm => confirm.Enabled(false)) .DocumentRequestHandlerUrl(Url.Action("DxDocumentRequest")) .Open(documentPath) )
using DevExpress.AspNetCore.Spreadsheet; using DevExpress.Spreadsheet; using DevExpress.XtraSpreadsheet.Export; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using System; using System.IO; using System.Linq; using System.Text; namespace AspNetCoreDemos.Spreadsheet { [Route("[action]")] public class SpreadsheetController : Controller { public ActionResult FromFile() { return View(); } [HttpPost] public void SaveToFile(SpreadsheetClientState spreadsheetState) { var spreadsheet = SpreadsheetRequestProcessor.GetSpreadsheetFromState(spreadsheetState); spreadsheet.Save(); } } }