This example adds custom functions to the list of functions available in the Expression Editor invoked in the WinForms End-User Report Designer.
This example implements the following functions:
-
The NewLineConstant function allows you to insert a new line into a string.
This function uses the Environment.NewLine constant that returns a new line string defined for the current environment. You should enable the XRLabel.Multiline property to enable line breaks in the XRLabel text.
-
The CustomFormatFunction(string format, object arg0) function accepts a format string and a value to format.
The function's Evaluate method uses the String.Format method to format a static string, data field, or a calculated field value.
Do the following to add a custom function to the End-User Report Designer's Expression Editor:
- Implement the ICustomFunctionOperatorBrowsable interface to define your new custom function.
- Call the CustomFunctions.Register method to register the implemented interface in the Report Designer.
- CustomFormatFunction.cs (VB: CustomFormatFunction.vb)
- NewLineFunction.cs (VB: NewLineFunction.vb)
- Form1.cs (VB: Form1.vb)
- Custom Functions in the Expression Editor (WinForms)
- How to use a custom function in a query expression
- Custom Functions
- How to: Implement a Custom Criteria Language Function Operator
(you will be redirected to DevExpress.com to submit your response)