Posted 11 April 2024, 11:57 pm EST
Hi,
Is their any event or way to know if a worbook recalc has ended?
Regards
Forums Home / Spread / SpreadJS
Posted by: n.serrette on 11 April 2024, 11:57 pm EST
Posted 11 April 2024, 11:57 pm EST
Hi,
Is their any event or way to know if a worbook recalc has ended?
Regards
Posted 14 April 2024, 9:39 pm EST
Hi,
As per my understanding, You’re looking for an event or method to detect whether all calculations have been completed.
For Designer, you can utilize the “FileLoaded” event to determine if synchronous function calculations have finished. In SpreadJS, the “RangeChanged” event can be used because spreadjs calculation is a synchronous process. hence, when you gets the RangeChanged event, that means, the whole calculation is done already. Hence, you could monitor the RangeChanged event, the judge the action in the eventArgs is “evaluateFormula”.
For asynchronous cases, these events may not be helpful as it’s unpredictable when they’ll finish. You could refer to this forum link for asynchronous function calculation completion: https://developer.mescius.com/forums/spreadjs/custom-function-not-calculated-when-fileloaded-event-occurs
If you still face issues and to assist you further, could you please provide the following details:
Can you specify the exact use case where you need to detect if all calculations are completed?
Which control are you using, SpreadJS or Designer, and what version?
Providing this information will allow me to offer better assistance.
References:
fileLoaded: https://developer.mescius.com/spreadjs/api/designer/classes/GC.Spread.Sheets.Designer.Events#fileloaded
RangeChanged: https://developer.mescius.com/spreadjs/api/classes/GC.Spread.Sheets.Events#rangechanged
Regards,
Priyam
Posted 18 April 2024, 7:59 pm EST
Thank for your reply, the RangeChanged event did the trick