Mulitple sheet JSON - data structure

Hi Syncfusion Team,

JSON data structure for single sheet document that is acceptable by spreadsheet component is for example:


data = [
{"Customer Name":"Romona Heaslip","Model":"Taurus","Color":"Aquamarine","Payment Mode":"Debit Card","Delivery Date":"07/11/2015","Amount":"8529.22"},     {"Customer Name":"Clare Batterton","Model":"Sparrow","Color":"Pink","Payment Mode":"Cash On Delivery","Delivery Date":"7/13/2016","Amount":"17866.19"}
]


How does JSON structure should look like if we would like to assign multiple sheet document?

3 Replies 1 reply marked as answer

SP Sangeetha Priya Murugan Syncfusion Team May 27, 2021 07:30 AM UTC

Hi Ignacy, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported requirement and we can be able to provide the data source for multiple sheets by using the sheet property as like as below. 
 
 
 <ejs-spreadsheet #default [openUrl]="openUrl" [saveUrl]="saveUrl" (created)="created()"> 
    <e-sheets> 
      <e-sheet name="Car Sales Report"> 
        <e-ranges> 
          <e-range [dataSource]="data1"></e-range> 
        </e-ranges> 
 
      </e-sheet> 
      <e-sheet name="Order details"> 
        <e-ranges> 
          <e-range [dataSource]="data2"></e-range> 
        </e-ranges> 
      </e-sheet> 
    </e-sheets> 
  </ejs-spreadsheet> 
 
 
 
For your convenience, we have prepared the sample based on our suggestion. Please find the link below. 
 
 
Could you please check the above details and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 


Marked as answer

IM Ignacy Mielniczek May 28, 2021 11:24 AM UTC

Hi Sangeeth,

Thank you for the answer. Now I see that I simply should ask a bit different question, cause the problem is in general opening Excel files into spreadsheet component.

On your examples, you are using spreadsheet.open() or spreadsheet.openJSON which are actually pretty similar, because both those functions feed spreadsheet in JSON file.


The real question is are you able to say what kind of parser are you using to parse excel files into JSON on server side or share this code.

This component needs quite complex JSON file to display data and for now there is no information in documentation about building it at all.



Kind regards,


SP Sangeetha Priya Murugan Syncfusion Team May 31, 2021 09:12 AM UTC

Hi Ignacy, 
 
Thank you for your update. 
 
We have checked your reported requirements and we would like to let you know that open method is used to open the excel file blob in spreadsheet. For more details, please refer the below link. 
 
 
And the openFromJson method is used the load the saved JSON of spreadsheet using saveAsJson method. For more details, please refer the below link. 
 
 
We have done the Open/ Save (server side) functionality in ASP.NET. By using the Syncfusion XLSIO library we have converted the excel file to our supported JSON format in server side. For open/save action you need to specify the server-side action URL for openUrl and saveUrl respectively.  
 
And for demo purpose we have published our web service open/save action and mentioned in our demo site. You can also use this demo URL in your end or else you can use local service for open/save action.  And we have published our API services in the GitHub location, for more details please refer the below links.  
 
 
 
Could you please check the above sample and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 


Loader.
Up arrow icon