|
Caution: Always back up your projects before beginning the conversion process. |
Upgrading from an ActiveReports for .NET 3.0 project
You can upgrade an ActiveReports for .NET 3.0 project by using the converter utility(see the section Upgrading from an ActiveReports for .NET 1.0 or 2.0 project located below), or by opening it in Visual Studio, replacing the old references with the new versions (adding the new Document reference) and correcting two errors in the code.
To update the project references
- Open the Visual Studio project that contains the reports that you want to upgrade.
- In the Solution Explorer, click the Show All Files button.
- Expand the References folder, and make note of which ActiveReports references you use in your project.
- Right-click each of the ActiveReports3 references, and select Remove.
- Right-click the References folder and select Add Reference.
- In the Add Reference window that appears, select Version 6.x.xxx.x of the ActiveReports references.
|
Note: You also need to add the new GrapeCity ActiveReports Document reference to the project, as some of the code has moved. |
- Click the OK button to add the references and close the window. Many errors appear in the Visual Studio Error List window.
To correct the errors
- If the Visual Studio Error List window is not showing, drop down the View menu and select Error List.
- In the Error List window, double-click the warning that states that ActiveReports3 could not be defined.
- In the report code, ActiveReports3 is highlighted. Change ActiveReport3 to ActiveReport. This resolves most of the errors in the list.
- In the Error List window, double-click the warning that states that ActiveReports3.FetchEventArgs could not be defined.
- In the report code, change ActiveReport3 to ActiveReport.
- Close and reopen the design view of the report.
Upgrading from an ActiveReports for .NET 1.0 or 2.0 project
To run the converter utility for old RPX files
Because ActiveReports 6 writes its report layout files in C# or Visual Basic.NET, reports that were built with ActiveReports for .NET 1.0 and 2.0 as RPX files need to be converted to run in the new environment. ActiveReports 6 includes a converter that makes this an easy process.
|
Caution: The converter utility does not support version 1.0 or 2.0 reports that use inheritance. To convert these reports, you must first:
- change the base class of the inherited report to ActiveReport
- ensure that the InitializeReport method is free of Overrides or similar modifiers
|
The naming convention for controls changed as of version 3. Previously (in versions 1 and 2) controls could be similarly named by using a different case, as in "Test" and "test," but ActiveReports 6 (and 3) require control names to be unique. When you load an RPX that has two controls with the same names but different cases, the report does not load and an error occurs. In order to avoid this, give each control a unique name and update the names in the code-behind.
- Open an existing ActiveReports for .NET 1.0 or 2.0 project in Visual Studio®. The report appears in the Solution Explorer as an RPX file.
- From the Tools menu, select Convert to ActiveReports 6.0 to open the ActiveReports Report Converter. The converter displays a list of all RPX files in your project, including any in subdirectories.
- Click OK to convert the files. The reports appear in the Solution Explorer as C# or Visual Basic files and all references to earlier versions of ActiveReports are updated.
|
Note: We recommend that you check the Active Reports for NET 2.0 or Active Reports for NET 3.0 project before running the ActiveReports 6.0 Report Converter and make sure that the project has valid ActiveReports references. |
- If the old project used the rpt.Show method, an error appears in the Error List window. To correct the error, replace the code with rpt.Run, then add a Viewer control to the form and set the viewer.Document = rpt.Document. For details, see Viewing Reports.
Loading Old RDF Files
The Windows Forms Viewer control can still display RDF files, which are static copies of reports with data from the time at which they were saved, from older versions of ActiveReports. In most cases, the WebViewer can also display many of these files, although certain reports may not display correctly.
See Also
Related Sections
Getting Started