Adding a Custom Function
Our sample projects and report templates can help you learn the basics of working with our products.You can extend the report engine with your own functions that authors call from expressions in the designer.
Registering the function. Define the function signature, register it with the expression engine, and call it from a template expression during rendering.
Registering the function. Define the function signature, register it with the expression engine, and call it from a template expression during rendering.
var myFunc = function (value) {
return value.toUpperCase();
};
Stimulsoft.Report.Dictionary.StiFunctions.addFunction(
'MyCategory', 'MyFunction', 'MyFunction',
'Returns a string converted to uppercase', '', String,
'String in the uppercase', [String], ['value'], ['The text string'], myFunc);StiFunctions.addFunction registers the function with its category, name, description, return type and parameter metadata, plus the JavaScript implementation. It then appears in the designer's function list and can be used in any expression, e.g. {MyFunction("hello")}.