Monday, April 20, 2009

Deploying a vb.net Project containing Crystal Reports on a Windows 98 machine

Deploying a vb.net Project containing Crystal Reports on a Windows 98 machine

If, like me, you have been tearing your hair out trying to get a Windows application containing Crystal Reports deployed & running on Windows 98 operating system then this may be of some help. I should point out that I am not a professional programmer and so have pretty large (cavernous!) gaps in my knowledge. As a consequence, finding the solution to a problem can take time – the information is all out there, it’s just a question of knowing where to look. Hopefully the following text will pull the essential information together. Sorry if it’s a bit long winded but I’ve tried to include things which Net.Newbies, like me, may not know.

The Problem:

I had developed a Windows application within which I had embedded a couple of reports (produced using Crystal Reports). The application project ran fine on my development machine (Windows XP). I created a deployment project for this application. The application installed and ran fine on another XP machine (which also had Visual Studio installed on it). When I tried to install the application on a Windows 98 machine (which did not have Visual Studio, Crystal Reports etc. installed) all manner of problems arose. The main problem was an error which occurred each time I tried to open the report viewer – “Err: Report Load Fail”. I’ll list below the problems encountered.

Problem 1: At first I used the “Setup & deployment projects – Setup Wizard” to produce my deployment project. This produced a deployment project Ok but one which did not work (i.e. Deploy & Install) on a 98 machine.

Problem 2: Having solved problem 1 (see later!) I then had an application which deployed (installed) on a 98 machine but would not run. First reason for not running was the need to upgrade MDAC (see later!) and the second reason (which has caused the most trouble) was to modify the installation so that reports (Crystal Reports) would open and run on the 98 machine (this was the “Err: Report Load Fail”).

The Solution:

Some basic info first; I was using VB.Net (Visual Studio.net 2003) in a Windows Form. The version of Crystal Reports used was that which came bundled with Visual Studio (this appears to be 9.1.5000.0 according to the reference within VB Studio). The reports used are embedded within the project. Here’s what I did. Apologies in advance if much of this is common knowledge –but it’s usually the simplest point that if overlooked causes the whole thing to go pear shaped and fail to work.

Producing the Deployment Project:

Open Solution Explorer, right click on the “Solution Name” at the top and Add a New Project. On the window that appears, move to Setup and Deployment Projects. Click on Setup Project (not the wizard), put a name for your deployment project (make a note of the location where the folder that the deployment project will be created in) and then click OK. A File System dialog will appear – solution explorer should be displayed on the left of screen. Within solution explorer – right click over your deployment project and select Add – Project Output. Another window will appear – select Primary Output (make sure configuration is showing Active) and click OK. This will result in the detected dependencies being updated & a primary output icon appearing in the deployment project. Right click on the deployment project name again and Add – Merge Modules. Add the following modules.

Crystal_Database_Access2003.msm
Crystal_Database_Access2003_enu.msm
Crystal_Managed2003.msm
Crystal_regwiz2003.msm
VC_User_CRT71_RTL_X86_---.msm
VC_User_STL71_RTL_X86_---.msm

These were the appropriate modules for my application given that I am using VS 2003. You can check your specific needs by going to this site

click here

And finding the environment appropriate to you i.e. VB.net 2003, Full versions of Crystal Reports etc…

Right click on Crystal_regwiz2003.msm and go to its properties. Enlarge the MergeModuleProperties tree and enter the product licence key. This can be found by opening the Help menu on Visual Studio and then opening About Microsoft Development Environment. You will see the 19 character licence code for Crystal Reports in the Installed Products List.

Go onto Build – Configuration Manager . Check that the Project & Deployment Project which appear are set to “Release” and the Build check box for each is checked. Build the Project. If all is well the build should show no errors.

If this has gone according to plan you should now have (in the folder specified in the “location” window given when you added your deployment project) a debug and release folder. The release folder will contain

setup (application)
setup (config file)
an installer package.

The release folder is all that is needed to deploy the application on another machine.

Getting it to work on a 98 machine:

The client machine must have the net framework installed before you do anything.
You will have to manually install dotnetfx (this will not automatically happen, even if dotnetfx is included in the detected dependences of the deployment project). Dotnetfx is available as a free download from Microsoft.

Next install onto the client machine the latest MDAC (Microsoft Data Access Components) version (version 2.8 at the moment). This is available from Microsoft - link shown below.

click here

It should now be possible to install your application. From the client machine, find the release folder for your application (this can be anywhere – development machine, cd rom – you name it) and double click the setup (application) icon. Just follow the install wizard as it runs – decide your installation folder etc… and follow it all to the end.

Once your application has been installed you still have to do a couple of things to the client 98 machine in order to get the Crystal Reports to work.

The reason the “Err: Report Load Fail” occurred is apparently because the file “dbghelp.dll” doesn’t get installed during installation and that the following file “crqe.dll” doesn’t get registered with the 98 operating system during installation.
I found the necessary fix on the following Crystal Reports site.

click here

To sort this out do the following. Copy from your development machine “dbghelp.dll”. You will find it in Windows\System32 folder on your development machine. Paste this into the Windows\System32 folder on the client 98 machine.

Register the “crqe.dll” file with the 98 machine in the following way. Click Start then Run on the 98 machine. In the command line box that appears manually register crqe.dll by entering the path to the folder containing the file. Check on your 98 machine where the file is and enter the path. The command line should look something like this:-

Regsvr32 “c:\program files\common file\Crystal Decisions\1.0\bin\crqe.dll”

Change the bit in quotes to match your path. Then press enter. A message should come back to say the registering has been successful.

You should now be ready to rock & roll. Having carried out this procedure I found that the Crystal Reports viewer opened and displayed the reports in my application on the 98 machine – hope it works for you.

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home