This is a migrated thread and some comments may be shown as answers.

Formula field function

3 Answers 292 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
siegfried
Top achievements
Rank 1
siegfried asked on 02 Aug 2019, 12:27 PM
Hi, I am looking the possibilities of Telerik to make some "Formulas" (Standalone Report designer).

I am not talking about to make a simple "Hello Mr John Smith", but some of my fields in my database need to be "decrypted".

For example (stupid example just to be understandable) if I have a field CarDetails, and the field is made as the following :

<CarModel>;<CarCountry>;<CarYearOfFabrication>...

I need to use Splits, Count() etc... functions. In my case this is for some matrix, I need to know the dimension of the matrix, and make easy calculations between their fields.

Is this kind of stuff possible in Telerik?I am used to Crystal Reports where I do it without problem, but I wish to change to Telerik, if this kind of job is possible

Thanks in advance

3 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 07 Aug 2019, 07:19 AM

Hi Siegfried,

When you write an expression, you have access to many built-in fields, collections, and functions that you can use alone or combine with other terms. You can add function calls, operators, constants, fields, parameters, items from the built-in collections to an expression. Built-in function calls include aggregation, commonly used utility functions, and conversion methods. For more information, please refer to Expressions Reference chapter, where you can find all built-in functions, etc.

However, in some more specific scenarios like in your case, you can also add references to functions defined in your code. These functions are called user functions and allow you to extend the default behavior of the Telerik Reporting engine. Check the User Functions article to see how to utilize them.

Best Regards, Silviya
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
siegfried
Top achievements
Rank 1
answered on 07 Aug 2019, 10:02 AM

Hi, and thanks for answer.

I am beginning with Telerik, and still trying to use it (demo version). Would you have some documentation how to make it "step by step"?

Imeet the following problem :

I read about your user functions (link you gave me), but I couldn't find in documentation a concrete example on how to achieve that. Is there somewhere some sample I could use for it? Concretely I created my function in my project as described on your documentation.
But now, how can I create a report that uses it? Then is it necessary to create report from Visual Studio? Or can I create reports separately from VS, so my customers could create/edit themselves reports(buying a Telerik Report licence).

Regards,

 

0
Silviya
Telerik team
answered on 12 Aug 2019, 06:58 AM
Hi Siegfried,

If I understood correctly, the requirement is to use custom user function in a Standalone Designer report.

Basically, there is no difference when using custom user functions in Type (.CS) and Declarative (.TRDP) reports. Note that any public static method that resides in a loaded assembly can be invoked from an expression by its fully qualified name, including the full namespace and the name of the type it belongs to, and specifying the necessary parameters in the braces - check User Functions article.

Note that in order the custom function to be accessible in Standalone Designer for design purposes, it will be necessary to copy the assembly into the directory where the standalone report designer EXE is and register the corresponding assembly in the designer's config file, as explained in the Extending Report Designer article. The custom functions will appear under Functions->Misc - check the attached screenshot for clarity.

Best Regards,
Silviya
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
siegfried
Top achievements
Rank 1
Answers by
Silviya
Telerik team
siegfried
Top achievements
Rank 1
Share this question
or