-
-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Hi friend, how are you? I ended up finding a performance problem in the formulas when I reference another cell, I'll send you the code I used as an example:
protected override void OnAfterRender(bool firstRender)
{
Sheet = new Sheet(900, 100);
Sheet.Commands.PauseHistory();
Sheet.BatchUpdates();
for (int row = 0; row <= 900; row++)
{
for (int col = 0; col <= 100; col++)
{
if(row < 14)
Sheet.Cells.SetFormula(row, col, $"=(({row}+{col}*{3})/100)");
if (row >= 14 )
{
Sheet.Cells.SetFormula(row, col, $"=(B{row} + 5)");
}
}
}
Sheet.EndBatchUpdates();
Sheet.Commands.ResumeHistory();
base.OnAfterRender(firstRender);
}
I used it in Formula.razor
If you run it without the if (row < 14 ) just with
Sheet.Cells.SetFormula(row, col, $"=(({row}+{col}*{3})/100)") it will be super fast!
If you use Sheet.Cells.SetFormula(row, col, $"=(B{row} + 5)") it will take 5 minutes.
Do you know what it could be?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels