VB Migration Partner

KNOWLEDGE BASE - Forms and controls


Previous | Index | Next 

[HOWTO] Migrating VB6 reports to NET

VB Migration Partner supports migration of DataEnvironment designer, but not other kinds of reports that you can define directly in VB6.
Here are some hints for migrating common kind of reports used in VB6:

Microsoft Data Report (*.dsr)
If your application use Microsoft Data Report (*.dsr) reports, unfortunately no conversion is possible: there is no automatic conversion tool to perform the migration.
The easiest way to avoid compilation errors in your migrated application is by remarking out all the statements that contain a reference to Data Report or other unsupported designers.

For more information, please read the following article:
[HOWTO] Avoid compilation errors caused by unsupported designers.

Crystal Reports
Following notes have been tested with Crystal Reports version included in Visual Studio.

Good news for Crystal report users: no errors during migration have been observed.
If your VB6 application uses Crystal Report OCX component, before migration consider to add crystl32.ocx as a reference (remember to remove every Crystal Report control, placed on VB6 form before unchecking component reference), declare a new CrystalReport object when required and set all its properties, modified in VB6 designer, in the Form_Load, as follows:

In this way, you don’t need to create extra OCX wrapper class (by using AxWrapperGen tool, because no visual control is included in Crystal Report Control 4.6 ActiveX library).
After the migration, you should see your report exactly as in VB6 at runtime, *but* no subsequent changes (or updates) will be allowed in Visual Studio .NET because imported Crystal Reports files are saved in an obsolete format.

Fortunately, Crystal Report for Visual Studio allows importing of report saved in old VB6 format. Therefore, upgrading old CR report is possible but manual fixes to .NET code (which uses CR) are required.
To perform this “manual” migration with smallest effort, it’s advisable to extract all code that uses CrystalReport object in a separate module *before the migration*; in this way, you can use:

    '## SetOption RemarkMethodBody

The SetOption pragma correctly resolves method references without having to fix individual statements related to COM Crystal Report objects that cause a compilation error and replacing them with .NET CR references.

Here are steps to upgrade old reports:

  1. In the Visual Studio .NET Solution Explorer, right-click your migrated project to display the shortcut menu.
  2. Point to Add and click Add New Item.
  3. In the Add New Item dialog box, select Crystal Report from the Templates area. Click Open.
  4. In the Crystal Report Gallery, select From an Existing Report and click OK:

  5. Select old CR report:



    After this, your VB6 report is available in Visual Studio and all CR .NET assemblies are automatically added to your migrated project:



Previous | Index | Next 




Follow Francesco Balena on VB6 migration’s group on

LinkedIn





Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.




Code Architects and its partners offers remote and onsite migration services.

More details




Subscribe to our free newsletter for useful VB6 migration tips and techniques.

newsletter



To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice



A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial




The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote




Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers