[Solved] Reporting engine wont use my implementation of ISharedDataSourceResolver

1 Answer 20 Views
DataSources
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 from a report that uses a SharedDataSource..
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 configured.

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. The breakpoints dont get hit also, but when viewing the report in the webDesigner, the shared datasources get loaded correctly using the ISharedDataSourceResolver

I have the following configuration in the appsettings.json:

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

In program.cs I have the following:
As I understand this is for the reporting engine:
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 as I understand this is for the webDesigner: 
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")),
});

What am I missing? what is the correct way to configure the reporting engine to use my ISharedDataSourceResolver implementation?
The webReportDesigner does work correctly when using reports with sharedDataSources, It only happens when I instantiate the reporting engine manualy in the backend.

Kind regards


1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 10 Mar 2026, 09:20 AM

Hello,

Thank you for the provided information about the problem!

Given the sample code, I believe that you have a .NET-based project, and you use the ReportProcessor to render the reports.

In this case, the configuration file - appsettings.json, where the custom shared data source resolver is set to be used, is not automatically read by the ReportProcessor. Instead, you need to manually create an IConfiguration object from that file and provide it to the constructor of the report processor.

For example:

IConfiguration configuration = new ConfigurationBuilder()
	.SetBasePath(Directory.GetCurrentDirectory())
	.AddJsonFile("appsettings.json")
	.Build();

var reportProcessor = new ReportProcessor(configuration);

Please try this approach and let me know how it goes.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
DataSources
Asked by
R
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or