Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

19.15 Deploying to an ASP.NET Application

Deploying an ASP.NET Application

Deploying a web application is very similar to deploying a Windows application. As far as Crystal Reports is concerned, there is no difference in which merge modules you have to add. To show a different way to create a deployment project, this example walks you through the steps of adding a deployment project to an existing ASP.NET web application.

Open the project you want to deploy. Add the deployment project to it by selecting File | Add Project | New Project. Select Setup and Deployment Projects. Click on the template Web Setup Project and enter a name for the project. Click OK.


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


In the Add Project Group dialog box, select the Primary Output and Content Files items. Click OK.


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. So all text prior to the license key numbers which are 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 quantity.


As mentioned in the last section, even if you add the license key to your project correctly, you may still get an “Invalid Keycode” error when you run your project on the deployment machine. If you run into problems, search their support site and try everything possible.

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.

If your ASP.NET report doesn’t properly display either the toolbar buttons or the group tree images, you need to add a folder to the IIS Localhost. Create a new folder CrystalReportViewer2 and copy the \Images\Viewer and \Images\Toolbar folders to it. These folders are in the Crystal Reports folder within the Visual Studio 2003 program folder. This is where the icons needed to display the toolbar and group tree are located.