MS Visual Studio Import of reports from Crystal Reports to FastReport .NET

Microsoft Vistual Studio

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,199
Credits
4,009
Import of reports from Crystal Reports to FastReport .NET
September 1, 2021 by Alexey Tantzura

Often, the developers of report generators create their formats to store templates. For example, FastReport uses the .frx format for storing templates and .fpx for storing reports to be exported and Crystal Reports uses .rpt files.

This article will tell how to import a report template from RPT format created in Crystal Reports to FRX format, which is used in FastReport.

To import templates, you’ll need the desktop report designer. The import is possible when the correct RPT file is opened. You can add this feature to the designer if you compile a special add-on (plugin). Let's take a look at the whole process from start to finish.

First, download the plugin project. It is available Для просмотра ссылки Войди или Зарегистрируйся in the Add-ons section.

The required link is signed as “Converter from Crystal Reports (*.rpt) to FastReport .NET (*.frx)”. When you click on it, the archive will be downloaded, which you must unpack to any convenient location. Then you need to open the FastReport.RPTImportPlugin.sln file using Visual Studio.

Download the package required for the work of the plugin. It is called “Crystal Reports, version for Visual Studio” and can be downloaded Для просмотра ссылки Войди или Зарегистрируйся (registration at sap.com is required).

Several download options will be offered via the link. Download and install the following package, available in 32-bit and 64-bit versions:
  • SAP Crystal Reports for Visual Studio (SP30) runtime engine for .NET framework MSI.
The following links will be configured in the downloaded FastReport.RPTImportPlugin project:
1630593352129.png
Delete all links mentioning FastReport and CrystalDecisions, and then add links to the current files:

1) CrystalDecisions.CrystalReports.Engine.dll and CrystalDecisions.Shared.dll. After installing the downloaded package, these DLL files will be located in the following path:

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\CrystalDecisions.CrystalReports.Engine
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\CrystalDecisions.Shared

2) FastReport.dll, FastReport.Compat.dll and FastReport.DataVisualization.dll. These DLLs are located in the root folder of the installed FastReport .NET. If you haven't changed the default installation destination, you can find them here:

C:\Program Files (x86)\FastReports\FastReport.Net

Make sure you are using the correct DLLs! If you have several versions of FastReport .NET installed, you may mistakenly select the wrong version of the DLL. The designer will not recognize the plugin or will not start.

Your list of links will look like this after these steps:
1630593369810.png

Compile the project. After that, go to the FastReport.RPTImportPlugin\bin\Debug folder and find the FastReport.RPTImportPlugin.dll file.

Open the report designer, and select the "Plugins" tab in the "Settings .." menu. Click on the “Add” button and select the FastReport.RPTImportPlugin.dll file. After that, you will see it in the list of installed plugins:
1630593388977.png
After adding the plug-in, restart the designer, and select "Open ...". After that, the file selection menu will open, and a new item should appear in the file format selector:
1630593400206.png
Attention! If during compilation, you select DLLs that do not match the DLLs used by the designer, then:

  • Designer may not start when you run it again.
  • The item “Crystal Reports File” will not be added to the export menu.
In these cases, reopen the FastReport.RPTImportPlugin project, remove FastReport.dll, FastReport.Compat.dll and FastReport.DataVisualization.dll from it, add the correct DLLs and recompile the plugin.

If the designer doesn't open after replacing DLLs, double-check all other steps. If this did not help, then remove the link to the plugin from the Config file and contact our support.

The Config file is located in the following path, and contains a number of FastReport .NET settings:

…AppData\Local\FastReport
To remove connection with the plugin, find and remove the line starting with <Plugin Name and save the file. After that, the designer will open but without the plugin.

The whole line will look like this:

<Plugin Name="your path to the plugin\FastReport.RPTImportPlugin.dll"/>

Please note that there are some technical limitations when importing. For example, configured data source connections will not be saved, and some objects will be output with small inaccuracies. If you are not satisfied with any aspect of importing templates, please contact our technical support. We always strive to improve our products, including improving the quality of import reports.

To sum up, by this moment you should have a compiled plugin that you added to the FastReport designer. After these steps, you can open RPT files created in Crystal Reports in the FastReport .NET designer and save them as FRX files, i.e. report templates for FastReport .NET.