Telerik Reporting Cannot Coexist with Telerik UI for ASP.NET Core
Environment
| Product | Progress® Telerik® Reporting |
Description
I created a new Telerik ASP.NET Core MVC Application with a Telerik Grid and it worked as expected.
In the same project, I added a new Telerik HTML5 Report Viewer Page item and the needed Reporting REST Service with a sample report. The report was displayed successfully when I ran the project. However, when I went back to the Grid, it stopped working.
Solution
The issue is due to the Newtonsoft.Json package that is required by Telerik Reporting. By default, the Telerik UI for ASP.NET Core product uses alternative JSON serialization.
In order to use Newtonsoft.Json for the serialization in Telerik UI for ASP.NET Core, the following serializer settings must be set in the AddNewtonsoftJson constructor:
services.AddRazorPages().AddNewtonsoftJson(options => options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver());
For more information, you may have a look at the ASP.NET Core JSON Serialization - Telerik UI for ASP.NET Core article.
See Also
- ASP.NET Core JSON Serialization - Telerik UI for ASP.NET Core
- Hosting the Telerik Reporting REST Service in ASP.NET Core in .NET 6 and .NET 7 with Top-Level Statements
- Hosting the Telerik Reporting REST Service in an ASP.NET Core Application in .NET 6 and .NET 7 with Startup.cs
- Hosting the Telerik Reporting REST Service in an ASP.NET Core Application in .NET Core 3.1