How to correct implement a custom report source resolver with instance report source

1 Answer 578 Views
Report Viewer - ASP.NET Report Viewer - Blazor
Andrey
Top achievements
Rank 1
Andrey asked on 10 Aug 2021, 07:33 AM | edited on 10 Aug 2021, 08:03 AM

I need to implement a custom report resolver that will return an instance report source as the report source.

The inherited ResolveReport method from ReportSourceResolverBase in CustomReportSourceResolver is called 3 times (with 3 requests sent: client registration, instance creation, document creation) => 3 times a ReportSource instance is created, which is undesirable, since it is necessary that it be created once when you open the ReportViewer.

Is there some way to implement this behavior?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 12 Aug 2021, 01:26 PM

Hello Andrey,

The custom resolver should implement the IReportSourceResolver interface. Its method Resolve() is invoked with the reportSource.report passed as the first argument in order to return the correct server-side ReportSource supposed to be used by the Reporting engine. 

For more information, please see the How to use Custom Report Source Resolver and Custom Report Document Resolver article.

Thank you for using Telerik Reporting!

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Sami
Top achievements
Rank 2
Iron
Iron
Iron
commented on 01 Jul 2023, 01:45 AM

Hi:

Im trying to implement this, but the custom resolver is never called:

This is my custom resolver:

 

This is the way that Im trying to call it:

 

 

 

Dimitar
Telerik team
commented on 05 Jul 2023, 08:33 AM

Hi Sami,

We discussed this in a separate ticket to also share it with the community,  the problem was that the custom resolver was the fallback resolver of another fallback resolver, and was thus never getting reached.

The solution is to either only use the custom resolver or to add the others as fallbacks:

builder.Services.TryAddSingleton<IReportServiceConfiguration>(sp => new ReportServiceConfiguration
{
    ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
    HostAppId = "Net7BlazorNativeDemo",
    Storage = new FileStorage(),
    ReportSourceResolver = new CustomReportSourceResolver(System.IO.Path.Combine(reportsPath))
});
Tags
Report Viewer - ASP.NET Report Viewer - Blazor
Asked by
Andrey
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or