Report Designer for .NET Core and .NET 5 Projects (CTP)
- 4 minutes to read
This document describes how to use the DevExpress Visual Studio Report Designer in applications that target .NET Core 3.1 / .NET 5.
The VSREPX File Format
For .NET Standard, .NET Core, .NET 5 projects, the Report Designer generates VSREPX files. VSREPX is an XML-based file format that stores report data. This format has the following differences from the REPX report definition format:
- You cannot open VSREPX files in an End-User Report Designer.
- The LoadLayout(String) and LoadLayoutFromXml(String) methods do not accept VSREPX files.
You can convert VSREPX files to REPX format:
- At design time, open the .vsrepx file in the Visual Studio Report Designer and save the report to REPX.
- At runtime, call report’s SaveLayoutToXml(String) method to produce a .repx file.
- Visual Studio 2019 16.8 or later.
- .NET 5 SDK or later.
- A WinForms, WPF, ASP.NET Core, Console, or Class Library application that targets .NET Core 3.1, .NET 5, .NET 6, or later.
- DevExpress Components v21.1 installed with the Unified Components Installer and used in the application. See Upgrade Notes for more information.
Enable the New Report Designer for .NET Apps
The Visual Studio .NET Core Report Designer extension allows you to create, design, and bind to data reports in .NET Core and .NET apps. The out-of-process Report Designer extension allows you to bind reports to Entity Framework and Object data sources in Visual Studio.
Do the following to enable the out-of-process Visual Studio Report Designer for your .NET Core or .NET 5 project:
Double click the newly added *.vsrepx file in Visual Studio to open it.
Expand Visual Studio’s XtraReports menu and click the Designer Options item to invoke the Report Designer Options dialog. Enable the Use the preview Report Designer (CTP) for .NET /.NET Core apps property in the Design category.
Restart Visual Studio and reopen the Report Designer.
The Report Designer extension is now active. It is invoked when you add a new report to your application or edit an existing report.
Migrate a Report in the Report Designer
All reports created or used in version 20.1.6 or later should work as expected in .NET Core and .NET 5 projects.
To modify a report from an earlier version in a .NET Core or .NET 5 application, use the following steps:
Make backups of all files related to your report.
Modify your report(s).
If you have access to the .NET Framework version of your app:
Open the report designer, invoke the report’s smart tag, and click Save. Review the following help topic for more information: Save Report Layouts. Save the file with the *.vsrepx extension. Make certain to save the Report XML file (the layout in XML format, not CodeDom).
If you have already migrated your app to .NET 5:
- Modify your application code to instantiate the report at runtime and use the XtraReport.SaveLayoutToXml method to store the XML file. Run the application in debug mode to generate the file.
Backup all files related to your report (the *.cs, *.Designer.cs, *.resx files) and unload them from your .NET Core or .NET 5 project.
Add a new blank report to your project as described in the following help topic: Add a New Report. This action generates *.vsrepx, *.Designer.cs and *.cs files.
In the report’s smart tag, click Open/Import and select the XML file saved earlier to apply the layout to the newly created report, as described in the following help topic: Loading Reports using Application GUI.
The report is migrated. Build and launch your application to display the report’s preview at runtime.
The VSREPX format does not store event handlers. Move the code that contains these handlers code to the newly generated *.cs file. You can also use the report’s backup files created in the previous steps.