Built-in Functions
There is a variety of built-in functions available in the Report Designer. These functions can be accessed directly from the data dictionary, or from within the Expression Editor. Here is an example of a built-in function: {Trim(MyString)} or {Trim(MyDataSource, MyDataColumn)}.
The use of the Trim function in the above examples removes leading and trailing spaces from the result in the report.
.NET Framework Methods
Beyond the built-in functions, you can use any available .Net Framework methods. The following examples apply to string expressions:
{MyString.Trim()} – This eliminates leading and trailing spaces.
{“Test”.ToUpper()} – This converts the characters in the value to upper case “EXAMPLE.”
{MyString.Length} – This returns the length of the string. If the value of “MyString” is “Example,” the method would return 7.
The following examples apply to numerical expressions:
{Math.Round(MyValue, 2)} – This rounds the number to two decimal places.
{Math.Sqrt(MyValue)} – This returns the square root of “MyValue.”
{MyValue.ToString() + “times.”} – This converts the number to a string, and adds the word “times.” When “MyValue” is 8, this returns “8 times.”
If methods are available in .NET for the type you are using in a report, you can use them without restriction.