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 sourceCreate a VS 2005 Crystal Reports Project.
- Launch Visual Studio 2005
- Go to "New|Project" Menu.
- This dialog box will show up.
- 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.
- Choose the "Group.rpt" from " C:\Program Files\Microsoft Visual Studio 8\Crystal
Reports\Samples\en\Reports" folder
- Click "Open", the Crystal Reports project was created and it is all done. Here is
the screen shot of the finished project.
- 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.crystalmigration.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.
- Go to the menu "File|New|Project" Menu item.
- Choose "Windows Application", and keep every thing as default. Click on "OK" button.
- Make the form bigger and choose the Reporting Services Viewer under Data.
- Drag and Drop this ReportViewer component to the form. Resize the view properly
and choose "Dock in Parent Container"
- Now add the new datasetfor the project. Click on "Data|Add New Dataset". This new
dataset will be consumed by the SSRS report.
- 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.
- Click on "Next" and then "Next" again.
- 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.
- Add new item to the project, and choose "Report"
- Click "Add", the empty "Report1.rdlc" will be added to the project.
- Drag drop a field such as Country to the report body area so the "Report1.rdl" will
use the Dataset1 as the data source.
- 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".
- Rename "Group.rdl" to "Group.rdlc".
- 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"
- Now we can associate this report to ReportViewer.
- Next Choose the Data Source for this report. Click on the "Choose Data Source" as
in the screenshot above.
- Choose the "CustomerBindingSource" as the datasource for "Group.rdlc"
- 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
- 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@crystalmigration.com