Advanced Excel in built formulas

0
In Mendix, I am using the Advanced Excel module for exporting data to Excel. My Excel template has some in-built formulas. In the UI, I have a data grid with data. When I click the "Export to Excel" button, an Excel file should download with all the data from the UI. However, I want the formulas in the Excel template to remain inactive initially. They should only trigger when data is entered or modified in the respective Excel columns. Could you please provide a solution for this?
asked
1 answers
3

Hi Saranya, Great question! You're on the right track using the Advanced Excel module in Mendix, especially when working with templates that include formulas. What you're aiming for keeping formulas inactive until user interaction is achievable, but it requires a careful setup of the Excel template.

 

Excel formulas automatically calculate when data is present in referenced cells. So, to delay or prevent execution initially, you need to “defer” the formula execution.

 

Use Formula with IF Condition to Check for Data

 

Modify your formulas in the Excel template like this:(It was just an example)

Example : = IF(A2="", "", A2 * B2)

 

Effect:

  • Formula cell stays blank until A2 has a value.

  • Calculation only triggers when the user enters/modifies data in A2.

I hope this one helps you! :)

 

 

answered