[]
        
(Showing Draft Content)

ReportSheet Formula Functions

ReportSheet uses context when setting formulas in cells. When a context is set for a cell in preview mode, then the same context is used to calculate formulas. This indicates that the same formula can produce different results depending on the context.

The following code sample shows the different formula results applied to the C2 cell in various contexts.

templateSheet.setFormula(1, 3, "=C2");

// Context is B2, B2 is the salesman, so C2 will return the current salesman's sales.
templateSheet.setFormula(2, 2, "=SUM(C2)");

// Context is A2, A2 is the region, so C2 will return the current region's sales as an array.
templateSheet.setFormula(2, 3, "=C2");

// No Context, so C2 will return all sales as an array.
templateSheet.setFormula(4, 3, "=C2");
templateSheet.setFormula(5, 3, "SUM(C2)");

reportSheet.refresh();

The below image depicts how this context affects formula calculation.


RS-functions


With the Hierarchical Cell Indexes formula, you can get cell values, indexes, or rankings in a structured cell arrangement. ReportSheet also provides functions for pagination information, such as the current page number and page count.

Additionally, you can define template cell aliases which makes it easier to reuse formulas in ReportSheet.