Search
Wednesday, August 20, 2008 ..:: Articles ::.. Register  Login
  
How To Deploy Crystal Reports For VS.NET
by Sai Panyam Last Updated:18 Oct 2004 View Count:1191 Rating:( 1.27/ 9 ) from 37 Vote(s)
Summary
There are a few components that you need to add to the Setup project for distributing and deploying .NET applications using Crystal Reports for VS.NET. This article explains all the necessary components and where to get them. Just follow the steps and your Crystal Reports deployment for .NET will be a breeze.
Deploying Crystal Reports for VS.NET

The components needed for deploying are Report Files (.rpt), Merge Modules and the Rutime. This How-to shows you the steps involved in creating reports. So let’s get on with it.

Report Files (.rpt)

Report files (.rpt) need to be distributed along with your application. There are two ways in which you can distribute them and it is a matter for the architect of the application.

When reports are added to a .NET windows application, they are added by default as an ‘Embedded Resource’. This means that the report will be compiled into the assembly’s manifest and will not be loaded as a separate file. To avoid reports being compiled into the assembly’s manifest as an embedded resource, the way that a report is added needs to be changed. After adding a report to the project (See my sample on GOTDOTNET on how to do it).

1.      Highlight the report in the Solution Explorer window and from the Properties window change the Build Action property from Embedded Resource to None.

If we don’t embed report files, the report files must be manually added to Setup projects. The advantage being, reports can be easily modified and redeployed without recompiling and redeploying the entire assembly. The disadvantage is that strongly –typed report objects cannot be used in the application.

The advantage of embedded report files is that you don’t have to deploy report files separately and the users cannot modify them. The disadvantage being, if you modify a report, the entire assembly needs to be recompiled and redeployed.

This how to limits itself to Embedded Resource Report files

Merge Modules

There are four merge modules that need to be included in a setup project to deploy reports.

Ø       Managed.msm

Ø       Database_Access.msm

Ø       Database_Access_enu.msm

Ø       Regwiz.msm

    In addition to these there are two other merge modules that need to be added depending upon the reports. If any of your reports are based on ADO.NET dataset objects (which is like 9 times out of 10!!!). The VC_CRT.msm and VC_STL.msm merge modules also need to be added.

 

All the merge modules are installed to the following folder by default:

C:\Program Files\Common Files\Merge Modules\

 

By right clicking the Set up projects and choosing Add and then Merge Module...

We get to the following screen.

CRMergeModules.jpg

 

Below you will find what each of the merge module does and its function in deployment of reports.

 

Managed.msm:

The managed.msm is used to install all the Crystal Reports for VS.NET managed components, such as CrystalDecisions.CrystalReports.Engine.dll, CrystalDecisions.Web.dll and CrystalDecisions.Windows.Forms.dll.

 

Database_Access.msm:

The database_access.msm is used to install all database drivers the report uses to connect to various types of data sources. This merge module also installs export destination and format drivers, which is used to save a report in different file formats, for e.g. HTML, Excel etc. This merge module is used to install all non managed runtime components for Crystal Reports for VS.NET including charting components.

 

Database_Access_enu.msm:

The database_access_enu.msm is used to install language specific or localized components. Some of the localized charting and exporting components like PDF are installed by this component. Each language, in which the product is released, will have a specific version of this merge module.

 

Regwiz.msm:

The regwiz.msm is used to configure registration information on deployed computers and in order to track licensing information. A license key is needed when building with this merge module. This is very important. When this merge module is added to the setup project, it exposes a LicenseKey Property that must be set before building the project. You can find this property by first highlighting the merge module in the Solution Explorer and in the Properties pane under MergeModuleProperties. The license key would have been emailed to you when you register the product. This key is also available from the VS.NET Help|About … dialog, under the installed products list.

 

If the license key is not set, an error will occur when building the project and if the setup is installed on a target machine, without specifying the license key, various “Keycodev2.dll” errors will occur.

 

 MergeModuleProperites.jpg

 

VC_CRT.msm & VC_STL.msm:

These two merge modules are required because the database driver crdb_adoplus.dll is dependent on files installed by these merge modules.

When these modules are added, there is a MergeModuleProperties property which is set to Default. Click the drop down list to select a different folder from default. Select the Browse option to list folders available on the target machine. A system folder needs to be added before you can set this as the new target folder.

References

For further Information refer to this site:

http://support.businessobjects.com/search/default.asp?ref=default.asp_shortcuts

and search in the Knowledge Base for c2010681 and c2011205 Article IDs, alternatively search for Keycodev2.dll errors.

Please rate the quality of this article
Poor
Outstanding
Tell me why you rated this content this way. (optional)
 
Rating Spread

  

Copyright 2002-2005 Sai Panyam   Terms Of Use  Privacy Statement