Table 8.5 outlines additional scripting functions offered by SSRS. These functions don't directly aggregate or perform any other calculations on values. Table 8.5. Additional Scripting Functions Function Signature | Expression Type | Return Type | Description | Previous(Expression, [Scope]) | Object | Same as type of Expression | Returns the previous instance (value) of the expression within specified scope. | RowNumber(Scope) | N/A | Integer | Returns a running count of all rows in the specified scope. Scope controls reset of the running value, when scope is equal to: DatasetRunning value is not reset throughout the entire data set. GroupRunning value is reset on group expression change. Data regionRunning value is reset for each new instance of the data region. | RunningValue Expression, Function, [Scope]) | Determined by function parameter | Determined by function parameter | Uses a specified function to return a running aggregate of the specified expression. Same running value reset rules as for RowNumber() function. The expression cannot contain aggregate functions. | The RowNumber function can be used to change the background color of a table row: =IIf(RowNumber("DataSet1") Mod 2,"White","Gray"). This book covers two additional built-in functions InScope and Level in Chapter 12, "Grouping, Sorting, and Aggregating Data, Working with Scope." Remember that in addition to built-in functions, developers can always write their own functions with custom code. If custom functions are used, the way to access the custom functions is by preceding the function name with " Code ," for example, Custom functions and assemblies are covered in Chapter 22. |