diff --git a/Document-Processing/Excel/Spreadsheet/ASP-NET-CORE/open-save.md b/Document-Processing/Excel/Spreadsheet/ASP-NET-CORE/open-save.md index a92e4a026b..12ae77037e 100644 --- a/Document-Processing/Excel/Spreadsheet/ASP-NET-CORE/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/ASP-NET-CORE/open-save.md @@ -370,6 +370,7 @@ public IActionResult Open(IFormCollection openRequest) { OpenRequest open = new OpenRequest(); open.AllowExternalWorkbook = false; + open.Guid = openRequest["Guid"]; open.File = openRequest.Files[0]; return Content(Workbook.Open(open)); } @@ -470,16 +471,11 @@ By default, the Spreadsheet control saves the Excel file and downloads it to the public string Save(SaveSettings saveSettings) { - ExcelEngine excelEngine = new ExcelEngine(); - IApplication application = excelEngine.Excel; try { - // Save the workbook as stream. Stream fileStream = Workbook.Save(saveSettings); - // Using XLSIO, we are opening the file stream and saving the file in the server under "Files" folder. // You can also save the stream file in your server location. - IWorkbook workbook = application.Workbooks.Open(fileStream); string basePath = _env.ContentRootPath + "\\Files\\" + saveSettings.FileName + ".xlsx"; var file = System.IO.File.Create(basePath); fileStream.Seek(0, SeekOrigin.Begin); diff --git a/Document-Processing/Excel/Spreadsheet/ASP-NET-MVC/open-save.md b/Document-Processing/Excel/Spreadsheet/ASP-NET-MVC/open-save.md index 1ec84e752b..0cfbbb77d4 100644 --- a/Document-Processing/Excel/Spreadsheet/ASP-NET-MVC/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/ASP-NET-MVC/open-save.md @@ -355,6 +355,7 @@ When you open an excel file that contains external workbook references, you will public ActionResult Open(OpenRequest openRequest) { openRequest.AllowExternalWorkbook = false; + openRequest.Guid = openRequest["Guid"]; return Content(Workbook.Open(open)); } ``` @@ -454,16 +455,11 @@ By default, the Spreadsheet control saves the Excel file and downloads it to the public string Save(SaveSettings saveSettings) { - ExcelEngine excelEngine = new ExcelEngine(); - IApplication application = excelEngine.Excel; try { - // Save the workbook as stream. Stream fileStream = Workbook.Save(saveSettings); - // Using XLSIO, we are opening the file stream and saving the file in the server under "Files" folder. // You can also save the stream file in your server location. - IWorkbook workbook = application.Workbooks.Open(fileStream); string basePath = _env.ContentRootPath + "\\Files\\" + saveSettings.FileName + ".xlsx"; var file = System.IO.File.Create(basePath); fileStream.Seek(0, SeekOrigin.Begin); diff --git a/Document-Processing/Excel/Spreadsheet/Angular/open-save.md b/Document-Processing/Excel/Spreadsheet/Angular/open-save.md index 4aa02a612c..863bdc1401 100644 --- a/Document-Processing/Excel/Spreadsheet/Angular/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/Angular/open-save.md @@ -456,6 +456,7 @@ public IActionResult Open(IFormCollection openRequest) { OpenRequest open = new OpenRequest(); open.AllowExternalWorkbook = false; + open.Guid = openRequest["Guid"]; open.File = openRequest.Files[0]; return Content(Workbook.Open(open)); } @@ -554,16 +555,11 @@ By default, the Spreadsheet component saves the Excel file and downloads it to t public string Save(SaveSettings saveSettings) { - ExcelEngine excelEngine = new ExcelEngine(); - IApplication application = excelEngine.Excel; try { - // Save the workbook as stream. Stream fileStream = Workbook.Save(saveSettings); - // Using XLSIO, we are opening the file stream and saving the file in the server under "Files" folder. // You can also save the stream file in your server location. - IWorkbook workbook = application.Workbooks.Open(fileStream); string basePath = _env.ContentRootPath + "\\Files\\" + saveSettings.FileName + ".xlsx"; var file = System.IO.File.Create(basePath); fileStream.Seek(0, SeekOrigin.Begin); diff --git a/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md b/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md index 7f76c4c6ac..32e9c43f8d 100644 --- a/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/Javascript-ES5/open-save.md @@ -413,6 +413,7 @@ public IActionResult Open(IFormCollection openRequest) { OpenRequest open = new OpenRequest(); open.AllowExternalWorkbook = false; + open.Guid = openRequest["Guid"]; open.File = openRequest.Files[0]; return Content(Workbook.Open(open)); } @@ -520,16 +521,11 @@ By default, the Spreadsheet control saves the Excel file and downloads it to the public string Save(SaveSettings saveSettings) { - ExcelEngine excelEngine = new ExcelEngine(); - IApplication application = excelEngine.Excel; try { - // Save the workbook as stream. Stream fileStream = Workbook.Save(saveSettings); - // Using XLSIO, we are opening the file stream and saving the file in the server under "Files" folder. // You can also save the stream file in your server location. - IWorkbook workbook = application.Workbooks.Open(fileStream); string basePath = _env.ContentRootPath + "\\Files\\" + saveSettings.FileName + ".xlsx"; var file = System.IO.File.Create(basePath); fileStream.Seek(0, SeekOrigin.Begin); diff --git a/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md b/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md index 0f3188f4ef..ded79155ba 100644 --- a/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/Javascript-ES6/open-save.md @@ -419,6 +419,7 @@ public IActionResult Open(IFormCollection openRequest) { OpenRequest open = new OpenRequest(); open.AllowExternalWorkbook = false; + open.Guid = openRequest["Guid"]; open.File = openRequest.Files[0]; return Content(Workbook.Open(open)); } @@ -526,16 +527,11 @@ By default, the Spreadsheet control saves the Excel file and downloads it to the public string Save(SaveSettings saveSettings) { - ExcelEngine excelEngine = new ExcelEngine(); - IApplication application = excelEngine.Excel; try { - // Save the workbook as stream. Stream fileStream = Workbook.Save(saveSettings); - // Using XLSIO, we are opening the file stream and saving the file in the server under "Files" folder. // You can also save the stream file in your server location. - IWorkbook workbook = application.Workbooks.Open(fileStream); string basePath = _env.ContentRootPath + "\\Files\\" + saveSettings.FileName + ".xlsx"; var file = System.IO.File.Create(basePath); fileStream.Seek(0, SeekOrigin.Begin); diff --git a/Document-Processing/Excel/Spreadsheet/React/open-save.md b/Document-Processing/Excel/Spreadsheet/React/open-save.md index aa50c0db23..86d93136a1 100644 --- a/Document-Processing/Excel/Spreadsheet/React/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/React/open-save.md @@ -434,6 +434,7 @@ public IActionResult Open(IFormCollection openRequest) { OpenRequest open = new OpenRequest(); open.AllowExternalWorkbook = false; + open.Guid = openRequest["Guid"]; open.File = openRequest.Files[0]; return Content(Workbook.Open(open)); } @@ -546,16 +547,11 @@ By default, the Spreadsheet component saves the Excel file and downloads it to t public string Save(SaveSettings saveSettings) { - ExcelEngine excelEngine = new ExcelEngine(); - IApplication application = excelEngine.Excel; try { - // Save the workbook as stream. Stream fileStream = Workbook.Save(saveSettings); - // Using XLSIO, we are opening the file stream and saving the file in the server under "Files" folder. // You can also save the stream file in your server location. - IWorkbook workbook = application.Workbooks.Open(fileStream); string basePath = _env.ContentRootPath + "\\Files\\" + saveSettings.FileName + ".xlsx"; var file = System.IO.File.Create(basePath); fileStream.Seek(0, SeekOrigin.Begin); diff --git a/Document-Processing/Excel/Spreadsheet/Vue/open-save.md b/Document-Processing/Excel/Spreadsheet/Vue/open-save.md index 84cd400908..43375a176b 100644 --- a/Document-Processing/Excel/Spreadsheet/Vue/open-save.md +++ b/Document-Processing/Excel/Spreadsheet/Vue/open-save.md @@ -615,6 +615,7 @@ public IActionResult Open(IFormCollection openRequest) { OpenRequest open = new OpenRequest(); open.AllowExternalWorkbook = false; + open.Guid = openRequest["Guid"]; open.File = openRequest.Files[0]; return Content(Workbook.Open(open)); } @@ -721,16 +722,11 @@ By default, the Spreadsheet component saves the Excel file and downloads it to t public string Save(SaveSettings saveSettings) { - ExcelEngine excelEngine = new ExcelEngine(); - IApplication application = excelEngine.Excel; try { - // Save the workbook as stream. Stream fileStream = Workbook.Save(saveSettings); - // Using XLSIO, we are opening the file stream and saving the file in the server under "Files" folder. // You can also save the stream file in your server location. - IWorkbook workbook = application.Workbooks.Open(fileStream); string basePath = _env.ContentRootPath + "\\Files\\" + saveSettings.FileName + ".xlsx"; var file = System.IO.File.Create(basePath); fileStream.Seek(0, SeekOrigin.Begin); diff --git a/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.jsx b/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.jsx index cf6ab5010c..6bb2cc853b 100644 --- a/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.jsx +++ b/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.jsx @@ -22,8 +22,7 @@ function App() { { method: 'POST', headers: { Authorization: 'YOUR TEXT' }, - body: formData, - mode: 'no-cors' + body: formData } ).then((response) => { response.blob().then((data) => { @@ -63,4 +62,4 @@ function App() { export default App; const root = createRoot(document.getElementById('root')); -root.render(); \ No newline at end of file +root.render(); diff --git a/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.tsx b/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.tsx index b64c889cbd..72089f9f96 100644 --- a/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.tsx +++ b/Document-Processing/code-snippet/spreadsheet/react/open-save-cs7/app/app.tsx @@ -22,8 +22,7 @@ function App() { { method: 'POST', headers: { Authorization: 'YOUR TEXT' }, - body: formData, - mode: 'no-cors' + body: formData } ).then((response) => { response.blob().then((data) => { @@ -63,4 +62,4 @@ function App() { export default App; const root = createRoot(document.getElementById('root')!); -root.render(); \ No newline at end of file +root.render();