Hi,
Actually two questions.
(1)If a user imports their excell spreadsheet with formulas, styles and values, is it converted into JSON and viewable by access the sheets property of the Spreadsheet? Does the spreadsheet control convert the excell properties into the sheets property (in JSON)? Is it converted like this:
Ideally, we would have one sheet with all the styles and formulas (really just references to other sheets with actual values) and the data would be referred to as a formula in the first sheet like this:
The value for cell A3 is in the formula, it is just referring to a cell in Sheet1; Sheet1!A1.
Is there any way to grab the multi sheet spreadsheet (sheets property I guess) as a JSON object and send it to an API? I see most of the examples have the sheet statically defined in the initialization of the of the component, then the data is bound from a separate dataSource.
I already did an experiment with swapping sheets, and this was somewhat successful, but the next step is to actually grab that sheets property from an API and somehow use the fromJSON() function to place the spreadsheet into the control, in addition to saving it off using JSON to an API.
I understand that it is easier to define the sheets statically when initializing the spreadsheet component, but I need a way to dynamically change the styles and save them off to an API.
Thanks,
George
further explaination on this:
This all being said...
Would be nice to have a tutorial on:
(1) how to dynamically assign a new sheets object to the sheets property in the Kendo Spreadsheets's options
(2) ...then push data into that sheets definition via a dataSource component in jQuery.
Hi George,
As far as I understand you need to add a sheet to the Spreadsheet and then set a dataSource to the new Sheet. Is this correct?
You can add a sheet using the insertSheet method:
- https://docs.telerik.com/kendo-ui/api/javascript/ui/spreadsheet/methods/insertsheet
You can bind a sheet to a datasource instance using the setDataSource method:
- https://docs.telerik.com/kendo-ui/api/javascript/spreadsheet/sheet/methods/setdatasource
However, The dataSource is designed to operate with flat data. You can review the supported field types in the dataSource.schema.model configuration option.
- https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/schema
When using the DataSource bound Spreadsheet there are some particular cases that you need to keep in mind. As described in the Specific Behavior section linked below Cell styles, formulas, and formats are not persisted in the data source.
- https://docs.telerik.com/kendo-ui/controls/spreadsheet/import-and-export-data/bind-to-data-source#specific-behavior
Please review the provided infromation and let me know in case you have any additional questions on the matter.
Regards,
Neli
Neli,
Well ultimately I would like to bring in an entire "sheets" property, with styles, formats, formulas first.... then bring in a couple of other sheets with raw data .... the first sheet with the styles, formats, etc.. would reference these other "data bound" sheets, ideally. The user would be able to export the data from the control optionally and put it in a PDF or Excel spreadsheet... but I am getting ahead of myself. I will see if I can sift through the examples and make it do what I want, this is great, a start... I have a long way to go. Will contact you with more questions as they come up.
Thanks again!
George
Hi George,
Take your time to examine and test the provided infromation and methods. Do not hesitate to contact us in case you have additional questions.
Regards,
Neli