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

How to do custom formatting with existing utility function, not format builder?

2 Answers 129 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
REI Software
Top achievements
Rank 1
REI Software asked on 06 Dec 2012, 04:38 PM
I need to convert some fields to SI Units and some more complicated numeric to string formatting. The format builder doesn't allow for this, and I have an existing class in a different assembly that I use for this that I know already works. How can I use this formatting function that I already have to format a number to a string?

Alright, I was able to execute my custom formatting function by added a static method in my report which uses it. Then the static function in the report shows up under the MISC items in the expression builder. 

How else can I add custom functions to the expression builder? Can I do it globally? Or do I have to create custom wrappers on each and every report?

2 Answers, 1 is accepted

Sort by
0
REI Software
Top achievements
Rank 1
answered on 06 Dec 2012, 08:23 PM
I found a section regarding this (I looked before, couldn't find it)

However, they say you can do

=Namespace.Class.StaticFunction(arg)

But this doesn't work for me, I get "The expression contains object ... which is not defined". I'm positive I've got the path right, and it is in an assembly which is being referenced.

I was able to use a static function inside the same assembly, but not a referenced assembly that is loaded.
0
Steve
Telerik team
answered on 11 Dec 2012, 02:55 PM
Hello Alan,

You can reference an existing assembly that would help you extend the default expression engine of Telerik Reportin, for more info see Extending Expressions help article.

All the best,
Steve
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Tags
General Discussions
Asked by
REI Software
Top achievements
Rank 1
Answers by
REI Software
Top achievements
Rank 1
Steve
Telerik team
Share this question
or