![](/forums/images/avatarimages/default.gif)
I was wondering if in telerik reporting they have a function field or formula field that can be re use in the texbox for many times. its like the crystal report formula fields.
Thank you
7 Answers, 1 is accepted
We do not have specific "formula fields" available like in Crystal. However you can handle your field value calculation in an user function in your favorite programming language. Then you can use the function in the report designer like so: = MyUserFunction(Fields.MyField).
Kind regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
![](/forums/images/avatarimages/default.gif)
Example :
=Fields.CustomerId in (1, 6, 7, 88, 22)
Thanks
We've answered your inquiry in the other forum thread you have opened, please review our answer there for more information.
All the best,
Steve
the Telerik team
![](/forums/images/avatarimages/default.gif)
Thanks
Hi Siegfried,
I agree. Please let me post the answer from my colleague in the other post here as well:
"Currently our expressions don't support the required syntax. However, you can achieve the same result with a simple user function:
public static object[] SplitArray(string values)
{
return values.Split(',');
}
Then you can use the above user function in the reports expressions as shown in the following sample:
Expression: =Fields.CustomerID Operator: In Value: =SplitArray("1, 6, 7, 88, 22")
"
Regards,
Silviya
Progress Telerik
![](/forums/images/avatarimages/default.gif)
If TRDP/TRDX report files are used, yes, the functions have to be in a separate assembly. However, if you are working with .NET CS report definitions, the custom functions can be part of the report library project which means that you will not need a separate assembly for them, the reports and the functions will be part of the same assembly produced from the report library project.
For example:
namespace MyReports
{
using System;
using Telerik.Reporting;
/// <summary>
/// Summary description for Report1.
/// </summary>
public partial class Report1 : Telerik.Reporting.Report
{
public Report1()
{
InitializeComponent();
}
public static string SayHello()
{
return "Hello";
}
}
}
Though it will be better to have the functions in a separate utility class. Then functions are called like Namespace.Class.FunctionName, for example, with the above code would be = MyReports.Report1.SayHello().
For information on the differences between the TRDP, TRDX, and .NET CS report definitions, you may refer to the Report Designer Tools Overview - Telerik Reporting article.
Thank you for sharing what is the scenario!
May I ask, what kind of user functions do you have, and what do they do? We could consider extending the built-in functions if a lot of people needed that functionality, you may even open a feature request with what functions you would like to see implemented out of the box - Progress® Telerik® Reporting Feedback Portal.
![](/forums/images/avatarimages/default.gif)
Data sources have the ability to create calculated fields. Those fields can be re-used as formulas up the chain. This provided the layer of re-usability that I needed for formulas.