Complex layout - load data

8 posts, 0 answers
  1. NS
    NS avatar
    183 posts
    Member since:
    Jan 2007

    Posted 21 Dec 2016 Link to this post

    Hi,

    In one scenario, I used a javascript Ajax call to get data and then I constructed my sheet like this:

    var sheet = spreadsheet.insertSheet({ rows: total });

    sheet.setDataSource(data);

    This way, the columns and rows are constructed by following the format defined in the JSON in data.

    Now ... see the attached screenshot. Is it even remotely possible to get a following excel layout using the approach above? I can re-construct the layout without loading data, but in an ideal world, the user would get a spreadsheet without data (but containing the columns layout), and then using some filters outside the spreadsheet, x-number of columns (with the salmon background) would be added. Customers, etc (with green background) would be added.

    Is there an alternative to setDataSource to bind data to a starting cell/row, etc.

    Thanks,

    Nicolas

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    418 posts

    Posted 22 Dec 2016 Link to this post

    Hello Nicolas,

    The required complicated layout of the Spreadsheet could be achieved by loading an xlsx (or JSON) to the Spreadsheet widget. Unfortunately, you won't be able to achieve similar layout, when using the DataSource of the Spreadsheet Sheets. The reason for that is the fact that you will be able to pass only data (array of similar objects) and no formatting options at all.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. NS
    NS avatar
    183 posts
    Member since:
    Jan 2007

    Posted 11 Jan in reply to Veselin Tsvetanov Link to this post

    Is there a way to limit the default number of rows and columns if you construct the spreadsheet by loading json using the widget?

    e.g. my SpreadsheetSheet C# object has 10 rows and 8 columns, but the widget is rendered to column AX and has 200 rows. Is there a way to avoid this or disable those cells?

     

  4. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    418 posts

    Posted 12 Jan Link to this post

    Hello Nicolas,

    You could set the number of rows and columns to be initially loaded in a Spreadsheet by specifying them in the JSON:
    var json = '{ "activeSheet": "Products", "columns": 5, "rows": 5, "sheets": [{ "name": "Products", "rows": [] }] }';
    var object = JSON.parse(json);
    var spread = $("#spreadsheet").data('kendoSpreadsheet');
    spread.fromJSON(object);

    Here you could find a simple implementation of the above.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. NS
    NS avatar
    183 posts
    Member since:
    Jan 2007

    Posted 13 Jan in reply to Veselin Tsvetanov Link to this post

    The ViewBag method works when using a MVC controller that is of type HTTPGET.

    If I use a $Ajax javascript, that calls a controller using HTTPOST, the spreadsheet is not rendered on the page.

    Strangely enough, if I look at the source of my webpage (after rendering), the JSON of the spreadsheet is in the source of the page ... any idea what could be causing this? (or should I submit an eticket for this)

     

    Thanks,

  6. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    418 posts

    Posted 16 Jan Link to this post

    Hello Nicolas,

    May I ask you to share here the view and the controller code that causes the issue observed?

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. NS
    NS avatar
    183 posts
    Member since:
    Jan 2007

    Posted 16 Jan in reply to Veselin Tsvetanov Link to this post

    Hi,

    I submitted e-ticket 1084269 (with demo project attached) to reproduce the issue.

  8. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    418 posts

    Posted 17 Jan Link to this post

    Hi Nicolas,

    I have answered to your question in the support ticket, that you have opened. In case you have any further questions on the same topic, I would suggest you to continue our communication there.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top