setArray does not refresh the formula in sheet

Posted by: lokesh0809 on 25 August 2019, 6:13 am EST

  • Posted 25 August 2019, 6:13 am EST

    I am getting formulas with getArray(true) and removing all formulas.
    Now after performing some operation I am setting the formulas again again using setArray(true). I see that the formulas for sparklines are not retained. I do see the formula in array, but it can not be set in cell with code. It seems that the Spread is not refreshed.


  • Replied 26 August 2019, 2:44 pm EST

    Hi,

    It seems that you are using the wrong syntax for setArray(). setArray() method expects the following 4 arguments:
    1). rowIndex
    2). columnIndex
    3). array with values/formulas
    4). setFormula flag: If true, set formulas; otherwise, set values.
    ex:
    var arr = ["=sum(B2:B5)"];
    sheet.setArray(0, 0, arr, true);


    API Reference:
    • setArray(): http://help.grapecity.com/spread/SpreadSheets12/webframe.html#SpreadJS~GC.Spread.Sheets.Worksheet~setArray.html

    If the issue persists, please share a small sample replicating the issue so that we could further investigate the issue.

    Regards
  • Replied 25 August 2019, 5:14 pm EST

    I know the usage of the setArray and getArray methods.
    Did you test this for Sparkline formulas?
    Is it working to remove and then set sparklines formulas again with getArray and setArray methods? Could you please share a sample application to demonstrate the same.

  • Replied 26 August 2019, 4:41 pm EST

    We tested out the spaklines formulas as well and it seems to be working as well. Please refer to the following sample which we used for testing and let us know if we are missing something in order to replicate the issue:
    https://codesandbox.io/s/spread-js-starter-zxi8i
    Also, please let us know the spread version along with the environment details such as OS, the browser you are using so that we may test on a similar environment once.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels