Only print when required 🖨️
As detailed in the report printing guide minimising the amount of report printing is important to maintain performance.
Here we detail several methods by which this can be achieved.
Method 1 - use a toggle
The simplest way of controlling when to print reports is to use a toggle.
In the example below we use an if statement to control what argument is provided to the Output
argument of the calculation.
=IF(E2,"report_HTML","")
At first the toggle is set to FALSE
meaning that the calculation returns a numerical result only.
By setting the toggle to TRUE
the argument report_HTML
is passed to the calculation, meaning that the report is output to the specified filepath.
Method 2 - print critical row only
A common pattern for using ArupCompute calculations in Excel is to create large tables. Often we are only interested in seeing detailed reports for critical items.
In the below example we are interested in seeing the report for the calculation that produces the maximum result only. We can ensure that we minimise our printing by simply checking if the current row contains the maximum result.
This pattern can easily be adapted for other conditions.