Spreadsheet - Open from Json, then open from Excel
I'm using the Template Marker functionality for spreadsheets. My pipeline is as follows :
Front - Vue : Open the Spreadsheet using it's JSON format
Back - .NET : Apply the Template Marker
Back - .NET : Save the result both in JSON and Excel format
Back - .NET : Return an AWS S3 link to those 2 files
Fail 1 :
When opening updating the file in the Vue component (initially opened from JSON) with the Excel file I get the error Unsupported File
I tried opening manually after downloading the file and it works perfectly.
Question : Is it possible to open the document from a JSON and then from an Excel file in the Vue Component ?
Fail 2 :
The JSON file returned from the .NET library doesn't look like the one returned from the Vue Component and thus is not accepted.
Here is my code :
QuestioAm I using the SaveAsJson properly ?
https://imgur.com/a/W0BukZf
Thank you,
Hi ,
I tried to bind data in synfusion excel in AJAX call two ways 1. from database and 2. form excel
1. When I tried to bind from data source data not reflect to spread sheet
function onSheetClick() {
var spreadsheetObj = $("#Spreadsheet").data("ejSpreadsheet");
fetch('/Spreadsheet/SpreadsheetFeaturesAfterLoad', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: (document.getElementById("filename")).value }),
})
.then((response) => response.json())
.then((data) => {
spreadsheetObj.openFromJson({ file: data }); // convert the json data to file and loaded into spreadsheet
})
}
2. when I tried to import from excel- it gives me below error
Cannot read properties of undefined (reading 'openFromJson')
function onSheetClick() {
var filename = "C:/Sample/Sample1.xslx";
var spreadsheetObj = $("#Spreadsheet").data("ejSpreadsheet");
fetch('/Spreadsheet/SpreadsheetFeaturesAfterLoad', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: filename }),
})
.then((response) => response.json())
.then((data) => {
spreadsheetObj.openFromJson({ file: data }); // convert the json data to file and loaded into spreadsheet
})
}
- 3 Replies
- 3 Participants
- Marked answer
-
TA Tuan Ardouin
- Mar 10, 2021 06:03 PM UTC
- Feb 16, 2022 02:21 PM UTC