[Solved] ReportEngine wont use my instance of the ISharedDataSourceResolver

0 Answers 7 Views
DataSources Programming
R
Top achievements
Rank 1
R asked on 05 Mar 2026, 12:28 PM

Hello,

I want to generate a pdf file on the backend using the reporting engine.
The report gets loaded with an instance of  my implementation of the IReportSourceResolver.
The report uses a SharedDataSource. And I have also an implemenation of the ISharedDataSourceResolver.

I use the reporting engine in the following way:

ReportSource reportSource = _resolver.Resolve(reportName, OperationOrigin.GenerateReportDocument, resolvedParams);
var processor = new ReportProcessor();
var deviceInfo = new System.Collections.Hashtable();
RenderingResult result = processor.RenderReport("PDF", reportSource, deviceInfo);


After saving the result to File I get the pdf, but is shows a big red error box with the following message:
An error has occurred while processing Table 'table1': Cannot instantiate the referenced DataSource. Could not find file 'C:PATH TO A SHARED DATA SOURCE FILE'

This error lets my think that the reporting engine is not using its configured instance of the ISharedDataSourceResolver and is using the default filebased resolver(?).

I have it configured with the following value in the appsettings.json file:

  "telerikReporting": {
    "processing": {
      "sharedDataSourceResolver": {
        "provider": "custom",        
        "parameters": [
          {
            "name": "typeName",
            "value": "NameSpaceAndClassName, containing AssemblyName"
          }
        ]
      }
    } 
  }


In program.cs I have the following:
For the reporting engine and viewer, as far as I understand:


builder.Services.AddScoped<IReportServiceConfiguration>(sp =>
{
    return new ReportServiceConfiguration
    {
        // ReportingEngineConfiguration = sp.GetService<IConfiguration>(), //(?? is this needed? does not load config either
       Storage = new FileStorage(),
       ReportSourceResolver = sp.GetRequiredService<DatabaseReportSourceResolver>()
    };
});

And for the designer, as far as I understand:

builder.Services.AddScoped<ISharedDataSourceStorage, DatabaseSharedDataSourceStorage>();
builder.Services.AddScoped<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration
{
    DefinitionStorage = new DatabaseDefinitionStorage(sp.GetRequiredService<IReportDefinitionDataStore>()),  
    SharedDataSourceStorage = sp.GetRequiredService<ISharedDataSourceStorage>(),
    SettingsStorage = new FileSettingsStorage(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Telerik Reporting")),
});
How to get an instance of the ReportProcesser that is configured correctly and uses my implementation of ISharedDataSourceResolver?

The webDesigner is working, and does load the shared datasources. The problem is with the Reporting engine.

Hope for some clarifaction
Kind regards
R
Top achievements
Rank 1
commented on 06 Mar 2026, 08:34 AM

At first I did not see the message saying that my post was up for review before it gets shown here on the forums. I thought I made a mistake, and now I posted somewhat the same question twice... 
I think this post can be closed/removed. And hope I get an anwser in my other post.

No answers yet. Maybe you can help?

Tags
DataSources Programming
Asked by
R
Top achievements
Rank 1
Share this question
or