Skip to main content
All docs
V23.2

Report File Formats (CS/VB and VSREPX)

  • 3 minutes to read

When you add a new report to a Visual Studio project, you can choose the DevExpress Report item in the Add New Item dialog:

Add a Report From Template in Visual Studio

The CS/VB File Format

If you choose the DevExpress Report item, the designer serializes the report in the following files:

  • ReportName.Designer.cs(.vb) – contains a report definition in the CodeDOM format. The designer generates code in this file automatically while you create a report.
  • ReportName.cs(.vb) – this file is intended for custom code. For example, the file can contain code of report event handlers.
  • ReportName.resx – includes report resources.

The CS/VB file format is the recommended format for report classes in a Visual Studio project.

The VSREPX File Format

The VSREPX file format is a legacy format that was used for report serialization in the initial development stages of the Report Designer for .NET/.NET Core. You can choose the DevExpress Report (.vsrepx) item if you want to add a new report to the project that already contains reports stored in .vsrepx files. If you choose this item, the designer serializes the report to the following files:

  • ReportName.Designer.cs - contains code that loads a report definition from a *.vsrepx file.
  • ReportName.cs - stores custom code.
  • ReportName.vsrepx - contains a report definition in XML-based format.

The following specifics apply to the .vsrepx file format:

  • The .vsrepx file format is the only format available for report serialization for .NET/.NET Core projects created in Visual Studio 2017.

  • You cannot use report inheritance if you store a report in a *.vsrepx file. Convert your *.vsrepx file to a *.cs file if you want to inherit from a *.vsrepx report. Refer to the following section for instructions: Convert a VSREPX File to a CS File.

  • *.vsrepx files should not be used as *.repx files. If you pass a *.vsrepx file to a report’s LoadLayoutFromXml method, the following exception occurs:

    You cannot use the LoadLayoutFromXml method to open a Visual Studio Report Designer’s internal working file. Use the Save command in the Visual Studio Report Designer to create a standard report template (REPX) file.

    If you want to use the LoadLayoutFromXml method to load a report definition from XML, save your report to a *.repx file and pass the saved file to this method.

Convert a VSREPX File to a CS File

Manual Conversion

  1. Open your project in Visual Studio and double-click a *.vsrepx file to invoke the Report Designer.
  2. Save the report to a *.repx file.

    Save a report

  3. Add a new blank *.cs report to your project.

  4. Import the saved *.repx file to the new *.cs report.

    Import a report

  5. If your report stored in a *.vsrepx file contains custom code, copy this code to the new *.cs report.