Telerik Appsetting setting

1 Answer 336 Views
DataSource SQL Programming
n/a
Top achievements
Rank 1
n/a asked on 27 Dec 2022, 07:44 AM

Hi Support team, 

Currently, Telerik reads the appsettings.json file to get the connection string. Here we have 3 different servers for DEV , staging and production environements and we also have Multiple appsettings files. see attached screenshot. 

For Code, we have already written code that for the DEV server, all configs are read from the appsettings.Dev.json file and for the staging server all configs are read from appsettings.staging.json.

 

Now, what happened when we are creating a pdf file from Dev server from Code, It read appsetting.json file for the connection string that's wrong connection string for DEV server. so, Wrong data occupied and report is not made properly.

Could you please share any solution for my issue? 
Please note that we can't edit appsetting.json file each and every time we deploy code. 

n/a
Top achievements
Rank 1
commented on 29 Dec 2022, 12:05 PM

There is some emergency. Please help me out. 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 29 Dec 2022, 03:13 PM

Hi Danny,

Thank you for the provided information!

Initially, it is said that the DEV server is indeed reading the configuration named appsettings.Dev.json, however, in the next paragraph, it is said that when the report is exported to PDF from the DEV server, it is reading the wrong configuration file.

Would you please specify exactly what is the scenario here? Do you render using the ReportProcessor or via a Telerik Reporting REST Service?

ReportProcessor

My assumption is that the issue appears when you are using the ReportProcessor class to render the report. If that is indeed the case, please follow 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 use a specific appsettings configuration with the ReportProcessor.

ASP.NET Core Configuration

In case the ReportProcessor is not being used, then please read the MSDN Configuration in ASP.NET Core | Microsoft Learn article or check out this StackOverflow thread - c# - Automatically set appsettings.json for dev and release environments in asp.net core? - Stack Overflow.

I hope this will help, please let me know if you have any further questions.

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/.
Tags
DataSource SQL Programming
Asked by
n/a
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or