Import external XLSX

Posted by: ricardo.aleixo on 22 May 2023, 3:45 am EST

  • Posted 22 May 2023, 3:45 am EST

    Hi.

    i’ve been recive a error when i import a XLSX file, but this file is loaded inside workbook but without Formulas.

    if I save the file in a JSON and import (using Spread JSON) it in DEMO, even knowing that it is deprecated, an error happens.

    **demo: **https://www.grapecity.com/spreadjs/designer/index.html

    exemple code.: https://dontpad.com/json-spread-exemple

    and this error happens in our application.

    this.workbook.fromJSON(existingJSON, {
          ignoreFormula: formula,
          ignoreStyle: estilo,
          frozenColumnsAsRowHeaders: coluna,
          frozenRowsAsColumnHeaders: linha,
          doNotRecalculateAfterLoad: calcularFormula,
        });

    can u help me? tks

  • Posted 22 May 2023, 11:30 pm EST

    Hello,

    As I can understand, when you import the excel file in SpreadJS, formulas are not imported.

    In the code snippet provided you, you are using spread.fromJSON() method to load the json into spread. In the spread.fromJSON() method, you are providing loading options object. The ignoreFormula property in the options may be true, that is why it loads the excel without any formulas. You may modify the code snippet as shown below so that formulas are always loaded from json.

    
    this.workbook.fromJSON(existingJSON, {
          ignoreFormula: false,
          ignoreStyle: estilo,
          frozenColumnsAsRowHeaders: coluna,
          frozenRowsAsColumnHeaders: linha,
          doNotRecalculateAfterLoad: calcularFormula,
        });

    The json that you have shared with us throws an error when it is loaded in SpreadJS.

    Could you please provide us the excel file or how you have generated the json? This will help us to conduct a more thorough investigation of the issue.

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels