Articles in this section
Category / Section

How to prevent formula calculation on importing excel file in JavaScript Spreadsheet?

1 min read

Description

This knowledge base explains how to prevent the formula calculation on importing excel file in JavaScript Spreadsheet.

Solution

It can be achievable by setting the “computeFormula” property as false in “Load” client-side event in Spreadsheet.

[JS]

 

$("#Spreadsheet").ejSpreadsheet({
    importSettings: {
    importMapper: "http://js.syncfusion.com/demos/ejservices/api/Spreadsheet/Import"
  },
    load: "onLoad"
});

 

[RAZOR]

 

@(Html.EJ().Spreadsheet<object>("Spreadsheet")
  .ImportSettings(import =>
   {  
      import.ImportMapper(“http://js.syncfusion.com/demos/ejservices/api/Spreadsheet/Import”);
   })
    .ClientSideEvents(
        events => events.Load("onLoad")
    )
)

 

[ASPX]

 

<ej:Spreadsheet ID="Spreadsheet" runat="server">
    <ClientSideEvents Load="onLoad" />
  <ImportSettings ImportMapper="http://js.syncfusion.com/demos/ejservices/api/Spreadsheet/Import" />
</ej:Spreadsheet>

 

[JS]

 

function onLoad(args) {
    args.computeFormula = false; // Prevent calculation while importing sheet  
}

By using the client-side method “calcNow”, you can re-calculate the formulas in sheets after importing, by passing the sheet index as an argument.

 

You can refer the below documentation link,

https://help.syncfusion.com/api/js/ejspreadsheet#methods:xledit-calcnow




Conclusion

I hope you enjoyed learning on how to prevent formula calculation on importing excel file in JavaScript Spreadsheet.

You can refer to our JavaScript Spreadsheet feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Spreadsheet example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied