Project Conversion

Migrate Visual Studio Crystal Reports Project to SSRS

Introduction

In this article we will discuss how to migrate a Visual Studio Crystal Reports project to SSRS. The example will use Visual Studio 2005 (VS 2005), however, for VS 2008 and 2010, the migration process is very similar. We start by showing how to create a VS 2005 Crystal Reports project. Then we will convert this project to SSRS step by step. To do the migration to SSRS, first we create a VS 2005 project, add the ReportViewer, and then add the dataset to be used by the converted SSRS report. We use Crystal Migration Services to convert Crystal Reports to SSRS rdl. Finally you will see the winform Crystal Reports project can be fully converted to SSRS.

We will start by creating a VS Crystal Reports project and then show detailed steps on how to fully convert this project to SSRS.

Download source

Create a VS 2005 Crystal Reports Project.

  1. Launch Visual Studio 2005
  2. Go to "New|Project" Menu.

     

  3. This dialog box will show up.

  4. Choose the Crystal Reports Application, and then click on OK button. The "Crystal Reports Gallery" dialog will show up, choose the "From an Existing Report" option since Crystal Reports creation is not the focus in this article. Click OK button.

  5. Choose the "Group.rpt" from " C:\Program Files\Microsoft Visual Studio 8\Crystal Reports\Samples\en\Reports" folder

  6. Click "Open", the Crystal Reports project was created and it is all done. Here is the screen shot of the finished project.

  7. Now the project can run. Here is the screenshot.

Convert the "Group.rpt" to SSRS rdl 2005 Format

Because the conversion quality is the key, we choose Crystal Migration Services to convert your Crystal Reports. The website URL is as follows.

http://www.crystalmigrater.com/Default.aspx

The "C:\Program Files\Microsoft Visual Studio 8\Crystal Reports\Samples\en\Reports" can be fully converted by the advanced automatic conversion from Crystal Migration Services with no manual fix.

The converted group.rdl has been included in the download file.

Create a VS 2005 SSRS Project

After launching VS, do the following.

  1. Go to the menu "File|New|Project" Menu item.
  2. Choose "Windows Application", and keep every thing as default. Click on "OK" button.

  3. Make the form bigger and choose the Reporting Services Viewer under Data.

  4. Drag and Drop this ReportViewer component to the form. Resize the view properly and choose "Dock in Parent Container"

  5. Now add the new datasetfor the project. Click on "Data|Add New Dataset". This new dataset will be consumed by the SSRS report.

  6. Choose Database and click on "Next" button. Choose the Xtreme from Visual Studio 8. By the way, Crystal Reports has been installed with VS 2005 by default. If you do not have Crystal Reports installed, you need install Crystal Reports components to VS 2005.

  7. Click on "Next" and then "Next" again.

  8. Choose the Customer table and then click on the "Finish" button. This "Customer" table is the very one used in "Group.rpt". The dataset has been added to the project.

Fix the Dataset

We need create a new report to use the dataset we have just created. The purpose of this is to add the Report Data Source properly, so that we can bind this data source to the group.rdlc report later.

  1. Add new item to the project, and choose "Report"

  2. Click "Add", the empty "Report1.rdlc" will be added to the project.
  3. Drag drop a field such as Country to the report body area so the "Report1.rdl" will use the Dataset1 as the data source.

  4. Next, choose this report for ReportViewer.

    We need this step to have Dataset1, CustomerBindingSource and CustomerTableAdapter to be properly added to the project for later use.

Add the Group.rdl to the Project

There are two types of SSRS files. One is the ".rdl" for SSRS server, and the other is ".rdlc" for the client usually used in Visual Studio.

After our rpt to rdl conversion, the group.rdl cannot directly be used by ReportViewer, we need convert it to rdlc. The good news is that we do not need do anything, and we just need rename "Group.rdl" to "Group.rdlc".

  1. Rename "Group.rdl" to "Group.rdlc".
  2. Choose "Add new Item|Existing Item" and browse to "C:\Program Files\Microsoft Visual Studio 8\Crystal Reports\Samples\en\Reports" folder. Choose the "Group.rdlc" we renamed just now, and then click on "Add"

  3. Now we can associate this report to ReportViewer.

  4. Next Choose the Data Source for this report. Click on the "Choose Data Source" as in the screenshot above.

  5. Choose the "CustomerBindingSource" as the datasource for "Group.rdlc"
  6. Since there are external images and hyperlink in the report, we have to add the following code in the "Form1.Designer.vb".

            
                    Me.ReportViewer1.LocalReport.EnableExternalImages = 
                        True
            Me.ReportViewer1.LocalReport.EnableHyperlinks
                = True
                
  7. Now we can run the report project and we can get this screenshot.

Conclusion

We have shown VS 2005 Crystal Reports project can be fully migrated to SSRS. SSRS can do almost all Crystal Reports can do. If you want to know more about how to convert Crystal Reports rpt to SSRS rdl, you can directly contact Crystal Migration Services at support@crystalmigrater.com