Reporting configuration in multi-settings environments

1 Answer 18 Views
.NET Core General Discussions
René
Top achievements
Rank 2
Iron
Iron
Iron
René asked on 09 Apr 2025, 10:51 AM

I have base configuration in appsettings.json (.Net 9 application)

    "telerikReporting": {
        "assemblyReferences": [
            {
                "name": "My.Assembly.Reports"
            }
        ],
        "extensions": [
            {
                "name": "PDF",
                "parameters": [
                    {
                        "name": "FontEmbedding",
                        "value": "Subset"
                    }
                ]
            }
        ]
    }

It works. But now I have multi layered configurations. There is appsettings.json and multiple other configuration files as customer1.json, customer2.json etc. Every customer has own settings and ovn assemly with reports. All is registered in program.cs in standard way. And it does not work. Seems that reportings have some hardcoded logic to read only from file named appsettings.json and whole configuration system of .Net is ignored.

It ends with errors:

An error has occurred while processing Report 'XXX':
 The type "XXX.TelerikReport.ObjectDataSources.XXX.Root" contained in assembly 
"XXX.TelerikReport.ObjectDataSources, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" cannot be loaded. 
To help improve the application's security, the reporting engine prevents loading types that are not essentially needed or listed as trusted by the user. If you 
consider particular types or assemblies as trusted include them in the corresponding TypeReferences or AssemblyReferences element of the 
'Telerik.Reporting' configuration section in the application's configuration file

 

Am I right? How can I split configs to multiple settings files? Can reporting work with configuration system as designed in .Net?

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 14 Apr 2025, 07:10 AM

Hi René,

The Reporting Engine IConfiguration implementation is specified in the IReportServiceConfiguration implementation passed to the Reporting REST Service. I confirm the developer may provide a configuration different from the default one in the appsettings.json file.

You may check for samples in the article sections Setup the Program.cs file as a starting point of the Reporting REST Service Project with Top-Level Statements and Add Configuration Settings to the Program.cs file (Optional).

Regards,
Todor
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
.NET Core General Discussions
Asked by
René
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Todor
Telerik team
Share this question
or