Skip to content

DevExpress-Examples/reporting-winforms-custom-functions-in-the-expression-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reporting for WinForms - How to Implement Custom Functions in the Expression Editor

This example adds custom functions to the list of functions available in the Expression Editor invoked in the WinForms End-User Report Designer.

A Custom Function in Expression Editor

This example implements the following functions:

  1. 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.

  2. 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:

  1. Implement the ICustomFunctionOperatorBrowsable interface to define your new custom function.
  2. Call the CustomFunctions.Register method to register the implemented interface in the Report Designer.

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)