How to use Visual Studio Report Designer to edit CS Reports in .Net Core Projects

Environment

Product Version 13.0.19.116+
Product Progress® Telerik® Reporting
.Net Framework .NET Core 3.0+

Description

Currently, the .NET Core frameworks do not support the design time components we need for the Visual Studio Report Designer. Without these components we cannot provide a quality design-time experience.

This KB article describes a workaround for using the Visual Studio Report Designer to edit C Sharp reports hosted in a .NET Core ClassLibrary project.

Suggested Workaround

The CSharp code of a report definition is identical in .NET Framework and in .NET Core. For that reason, it is possible to link the report definition files hosted in a .NET Core ClassLibrary project to the corresponding files hosted in a .NET Framework ReportLibrary project. This way, all the changes made with the Visual Studio Report Designer to the report in the .NET Framework project will be automatically applied to the .NET Core project.

Lets assume that we already have a ReportLibrary project in .NET Framework. Here are the necessary steps to link it to a .NET Core ClassLibrary project:

  1. Create a new .NET Core 3.1 ClassLibrary project. You may delete the default CS file usually named Class1.cs.

  2. Add references to the following assemblies/NuGet packages in the project:

    • Telerik.Reporting - defines the needed report definition elements
    • System.Resources.Extensions - needed to resolve the resources from the RESX file
  3. Add the corresponding CS report file from the .NET Framework project to the .NET Core project through the Add -> Existing Item... option of the project context menu. alt text

When selecting the CS file make sure to select Add As Link from the Add Existing Item wizard. The corresponding DESIGNER.CS file will be added automatically.

alt text

  1. Add in the same way also the RESX file of the report definition.

  2. Reference the .NET Core ClassLibrary project in your .NET Core project hosting the Telerik Reporting engine. Pass the AssemblyQualifiedName of the report class to the Reporting engine. Use TypeReportSourceResolver for resolving your reports in a Telerik Reporting REST Service.

A demo solution demonstrating the approach may be found in our GitHub repo - VS Designer in .NET Core

See Also

Make Visual Studio designer work with .NET Core

In this article
Not finding the help you need? Improve this article