Add a custom function to the expression engine and call it from a report template during rendering.

Registering the function. Define the function signature, register it with the expression engine, and call it from a template expression during rendering.
StiFunctions.AddFunction("MyCategory", "MySum",
    "description", typeof(CustomFunction),
    typeof(decimal), "Calculates a sum of the specified set of values.",
    new[] { typeof(object) },
    new[] { "values" },
    new[] { "A set of values" }).UseFullPath = false;

this.Report = new StiReport();
StiFunctions.AddFunction registers the method with its category, name, description, return type and parameters. It then appears in the designer's function list under MyCategory and can be used in any report expression.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.