Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

19.14 Deploying to a Windows Application

Deploying a Windows Application

Create a new project with the Visual Studio IDE and select Setup and Deployment Projects. Click on the template Setup Project and enter a name for the project. Click the OK button.



Figure 19-6. New Windows deployment project.

In the Solutions Explorer window, right click on the deployment project and select Add | File.

Browse through the directory to find the Windows application that you want to deploy. Click the Open button to add it to the Applications Folder.

In the Solutions Explorer, right-click on the project name and select Add | Merge Module. In this example I add all the Crystal_* modules, but none of the VC_* modules because I didn’t use ADO.NET in my reports.


This next step the most important: set the License Key property of the Crystal_regwiz2003.msm module. Click on the module name in the Solution Explorer window so that its properties are displayed in the Properties window.

Click on the plus sign next to (MergeModuleProperties) to expand it. Below it there is the License Key property. Enter the license key that was assigned to you when you originally registered your version of .NET with Crystal Decisions. The easiest way to find this to click on the Help | About menu items in the IDE. It displays a list of the installed Visual Studio products and their assigned license keys.


Select the Crystal Reports product and click on the Copy button. This copies the entire string to the clipboard.

Right-click on the License Key property and select Paste. This puts the string into the property field. Unfortunately, it also put the product name. Delete all text prior to the license key numbers at the end of the string. Be careful that you don’t delete too many characters or that you don’t accidentally leave a leading space. The license key is nineteen characters long and you should count them to make sure you have exactly that number.



Even if you add the license key to your project correctly, you may still get the “Invalid Keycode” error when you run your project on the deployment machine. If you search the Crystal Decisions support site for more information, you will see that this can be caused by a variety of reasons: incorrect registry keys, DLL versions that don’t match, and insufficient permissions for the ASPNET account. In other words, by trying to keep you from illegally copying Crystal Reports, they created a deployment nightmare that is very difficult to troubleshoot and correct. From what I’ve seen, a very common problem is having multiple versions of CR.NET on the computer. People who install VS 2002 and VS 2003 can get problems with conflicting versions. There are also problems if you install CR 9/10 on your computer because there will be multiple assemblies on the computer. If possible, try building the installation on a different machine or uninstall and reinstall the Visual Studio tools to make sure all the libraries and registry keys are written correctly.

This is all that is required to deploy Crystal Reports applications. Just select Build from the Visual Studio menu and the setup files that you need to deploy your application will be created.