Get data from WebService while using excel file as template

4 posts, 0 answers
  1. Diego
    Diego avatar
    9 posts
    Member since:
    Jun 2018

    Posted 15 Nov 2018 Link to this post

    Hello!

    I'm trying to use a pre formatted xlsx file as a starting point for my spreadsheet, and then trying to load data from my webservice (using a DropDownList to select a year) into some of its cells, so that the user can change the value of those cells and then hit the save button so that I can retrieve both the values and the formulas of the edited cells. However, I'm having trouble finding a solution that covers all the steps required for my program to work:

    1) I tried using the SpreadsheetDocumentProvider to load my xlsx document, but then I don't know how to both load the data into the resulting spreadsheet, and also overriding its save function so that I can retrieve the values and formulas of the cells.

    2) I tried overriding the SpreadsheetDataBaseProvider, which lets me load info from my webservice and into the cells I want, however I don't know how to load the format of my xlsx file, tell it which value is selected in the "Year" DropDownList so that I can load the correct values, or how I can send a parameter to the SaveWorkbook Method so that I save only certain cells.

    Is it possible to do what I need with this control? Is there an example project I could use to learn more about it or should I use another controller entirely?

    Thanks.

  2. Vessy
    Admin
    Vessy avatar
    2093 posts

    Posted 20 Nov 2018 Link to this post

    Hi Diego,

    The custom content provider has a different context, so one of the options is to refer the page context inside the content provider, so you will get access to the controls on the page.

    The other option is to create a SpreadSheet document provider inside the custom provider, so you can traverse the sheets (using GetSheets()) and change the desired cells in the SaveWorkbook method of the provider.

    Regards,
    Vessy
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Diego
    Diego avatar
    9 posts
    Member since:
    Jun 2018

    Posted 20 Nov 2018 in reply to Vessy Link to this post

    Vessy said:Hi Diego,

    The custom content provider has a different context, so one of the options is to refer the page context inside the content provider, so you will get access to the controls on the page.

    The other option is to create a SpreadSheet document provider inside the custom provider, so you can traverse the sheets (using GetSheets()) and change the desired cells in the SaveWorkbook method of the provider.

    Regards,
    Vessy
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.

    Hi Vessy, thank you for your answer.

    The second option looks very promising, is there any example project or piece of code available that would get me on the right track regarding the implementation of a Spreadsheetdocumentprovider inside the custom provider? I tried looking for more documentation about the custom provider but what I found is very basic (https://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/data-binding/providers/custom-database-provider).

    Thank you for your help!

  4. Diego
    Diego avatar
    9 posts
    Member since:
    Jun 2018

    Posted 20 Nov 2018 Link to this post

    PD: Regarding the first option you have given me, I didn't quite understand how I would go about refering the page context inside the content provider, how would I do that?
Back to Top