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

# User Defined Functions

3 Answers 145 Views
Report Designer (standalone)
Top achievements
Rank 1
Peter asked on 16 Aug 2013, 07:44 PM
We have some internal staff using the Report designer to build different flavors of reports I have built in visual studio.

I previously provided them my report.dll so they could see those reports.

They have an expression in the report that slows down the processing of the report.  I would like to build a user defined function that could handle some of this and then I can use "SELECT CASE" statements, etc.   How can the current row of the dataset be based in a user defined function when it is called from an expression.  The expression is below.

= IIf(Fields.AdjType1 = "ETR",  "\$" + " " + Fields.AdjAmount1,IIF(Fields.AdjType2 = "ETR",  "\$" + " " + Fields.AdjAmount2,IIF(Fields.AdjType3 = "ETR",  "\$" + " " + Fields.AdjAmount3,IIF(Fields.AdjType4 = "ETR",  "\$" + " " + Fields.AdjAmount4,IIF(Fields.AdjType5 = "ETR",  "\$" + " " + Fields.AdjAmount5,IIf

(Fields.OptSvcCust5Code = "PARKT",  "\$" + " " + Fields.OptSvcCust5TotalAmt,IIF(Fields.OptSvcCust6Code = "PARKT",  "\$" + " " + Fields.OptSvcCust6TotalAmt,IIF(Fields.OptSvcCust7Code = "PARKT",  "\$" + " " + Fields.OptSvcCust7TotalAmt,IIF(Fields.OptSvcCust8Code = "PARKT",  "\$" + " " + Fields.OptSvcCust8TotalAmt,"")))))))))))))))))))))))))))))))))))))))

## 3 Answers, 1 is accepted

0
Squall
Top achievements
Rank 1
answered on 19 Aug 2013, 01:38 PM
Just use the DataObject instance:

=MyUserFunction(ReportItem.DataObject)
0
Peter
Top achievements
Rank 1
answered on 19 Aug 2013, 09:12 PM
Thank you for the information.

The documentation does not clearly indicate how to define parameter descriptions.
0
Stef
Telerik team
answered on 22 Aug 2013, 02:06 PM
Hello Peter,

Just to add that you can use and the DataObject.RawData to get the current record data. For more details:

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Tags
Report Designer (standalone)
Peter
Top achievements
Rank 1