Access to UDF Assembly - Telerik reports (Telerik.Reporting/17.2.23.1114)

2 Answers 15 Views
Rendering Report Designer (standalone) Report Viewer - ASP.NET
Carlos
Top achievements
Rank 1
Iron
Iron
Carlos asked on 01 May 2024, 06:25 PM

Hello Team, I'm trying to implement a User Defined Function to be access by Telerik Reports. Is a simple Replace function.

In Report designer I followed the instructions of copying the dll where the report designer is located. It runs fine using the following expression   TelerikFunctions.Telerik_F.Replace("t").

When I try to run it from an API, It does not return anything.

  • I added the TelerikFunctions.dll to the current project where TelerikReporting.dll is located.
  • I added the following entries on the  appsettings.json  
  •  

"configuration": {
"configSections": {
"section": [
{
"_name": "Telerik.Reporting",
"_type": "Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting",
"_allowLocation": "true",
"_allowDefinition": "Everywhere"
},
{
"_name": "Telerik.ReportDesigner",
"_type": "Telerik.ReportDesigner.Configuration.ReportDesignerConfigurationSection, Telerik.ReportDesigner.Configuration",
"_allowLocation": "true",
"_allowDefinition": "Everywhere"
}
]
},
"telerikReporting": {
"assemblyReferences": [
{
"name": "TelerikFunctions",
"version": "1.0.0.0",
"culture": "neutral",
"publicKeyToken": "null"
}
]
}

I also placed the function in the wwwRoot where the reports are located. But still, it doesn't recognize the function.    

Class Library containing UDF

2 Answers, 1 is accepted

Sort by
0
Accepted
Carlos
Top achievements
Rank 1
Iron
Iron
answered on 08 May 2024, 02:59 PM

After many trials I was able to figure why it was not reading the UDF. In one of the documentations I read, it suggests placing the UDF dll along with the Telerik.Reporting dlls. It really didn't quite work that way. These are the steps I took: 

  • From the project where the Telerik references are located, I removed the Telerik.Reporting  and UDF Assemblies that I added manually and left Telerik,Reporting NuGet packages as they were.
  • Added The UDF dll in API section
  • The project that contains the Teleri.Reporting dlls is referenced here as well (see second image) 

Hope this helps someone.

 

0
Dimitar
Telerik team
answered on 06 May 2024, 09:18 AM

Hello Carlos,

Thank you for the provided information!

May I ask how you render the reports in the project?

If you are using the Reporting REST Service through a Report Viewer, then the configuration that you have added to the appsettings.json file should be correct. However, if you render the reports through the ReportProcessor, it will be necessary to pass an IConfiguration instance to the constructor of the ReportProcessor generated from the appsettings.json file.

You may look into the How to pass configuration settings to ReportProcessor in ASP.NET Core application that does not use Telerik Reporting REST Service - Telerik Reporting KB article for details on how to do that.

If you need further assistance, please attach a trace listener to the project, preview the report that uses the custom function, and then attach the produced trace log to your reply - How to troubleshoot errors in ASP.NET Core projects - Telerik Reporting. I would appreciate it if you could also send more details about the project or the project itself so that I can get more familiar with the scenario.

I hope that the provided information will help and looking forward to receiving an update from you.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Carlos
Top achievements
Rank 1
Iron
Iron
commented on 06 May 2024, 08:40 PM | edited

Hello Dimitar,

We render the reports through the report processor so I followed the instructions provided in the link.

I can see the the appsettings.json loaded with the  telerikReporting section  along  with the  dll Name (TelerikFunctions), value, and version. (See Highlighted in blue).   The report for some reason still  can't see it. 

The only thing I can think of is that the Telerik assemblies are loaded through packages. So I also manually Loaded the TelerikReporting , Telerik.Reporting.WebSerciceDatasource and My dll TelerikFunctions in the assembly section. No luck. {See Second Image}.  Any suggestions are welcome.

Tags
Rendering Report Designer (standalone) Report Viewer - ASP.NET
Asked by
Carlos
Top achievements
Rank 1
Iron
Iron
Answers by
Carlos
Top achievements
Rank 1
Iron
Iron
Dimitar
Telerik team
Share this question
or