Get Calculated Value

2 posts, 0 answers
  1. Mattia
    Mattia avatar
    5 posts
    Member since:
    Jan 2015

    Posted 09 May 2017 Link to this post

    I have a spreadsheet with some formula (es. =A1*B2/5).

    So I get the Json data and I see that something like that

    {
          "name": "Sheet1",
          "rows": [
            {
              "index": 31,
              "cells": [
                {
                  "value": 5,
                  "format": "#",
                  "index": 1
                },
                {
                  "value": 10,
                  "formula": "B32*2",
                  "index": 2
                }
              ]
            }

    is it possibile to use the js to get the calulated data or exist a .net dll to convert js"excel" style formula to data?

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1201 posts

    Posted 11 May 2017 Link to this post

    Hi Mattia,

    In the exported JSON, the calculated value of the cell will be available in the value field for that respective cell. In the JSON sample, that you have sent, the value of the cell with formula B32*2 is 10.

    Here you will find a small sample demonstrating how such cell value could be retrieved using JS:
    var spread = $("#spreadsheet").data('kendoSpreadsheet');
    var sheet = spread.activeSheet();
    var range = sheet.range('F15');
    var value = range.value();

    Note, that the above uses methods from the API of the Spreadsheet, the Spreadsheet Sheet and the Spreadsheet Range objects.

    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