Sunday, July 27, 2008

Troubleshooting: [CrystalReport + ASP.NET]: Cannot deploy Crystal Report with ASP.NET in target machine

Building report using Crystal Report in ASP.NET website is quite straight forward. Maybe you would do these steps:
1 - Add new Crystal Report page
2 - Specify the data source of the report in Crystal Report page
3 - Drag and drop Crystal Viewer on the web page.
4 - Specify the report source
5 - Put a few line of code if needed.
6 - Run the program from Visual Studio 2005, and there your ASP.Net report come out.

These are the steps you see working in the development machine. Now, copy the webpage files to your target machine (any server without Visual Studio 2005 installed). Run it in the localhost. Can you see similar thing happen again OR another new mystery to be figured out? If the latter you see, then keep on reading...

ENVIRONMENT
=============
VS 2005
Crystal Report for VS 2005
ASP.NET 2.0
Win XP Service Pack 2


SYMPTONS
==========
1 - When open browser you've an error message " Could not load file or Assembly "CrystalDecisions.****" (The message is vary based one what kind of CrystalDecision DLL or Assembly files is missing)

REASON
=======
Some DLL or Assembly files are missing. Normally DLL files should appear under application root folder name "Bin" while the assembly must appear
in C:\WINDOWS\Assembly\

SOLUTION
=========
step 1) Copy DLL files to Bin folder.

crystaldecisions.crystalreports.engine.dll.
crystaldecisions.reportsource.dll
crystaldecisions.shared.dll
crystaldecisions.web.dll

COPY above DLL from "C:\Program Files\Common Files\Business Objects\2.7\Managed\" and PASTE them to "Visual Studio 2005\WebSites\[YourWebsiteName]\Bin\" (this path might vary depend on your initial chosen path)

Once, you've done this, you might have probably able to browse your website up to the page where the crystalreport document appears, here you'll face another problem saying

"Could not load file or assembly CrystalDecisions.ReportAppserver.*** ..."

This problem is caused by MISSING ASSEMBLY FILES which is located inside c:\windows\assembly\.

for details instruction, go to step 2.

==================================================

step 2) Install CrystalReports Assembly files

a) for 64-bit server:
COPY installation program called "CRRedist2005_x64.msi" from "C:\Program Files\Microsoft Visual Studio 8\Crystal Reports\CRRedist\X64" from development machine and paste into target machine. Then, double click on it to start the installation.

b)for 32-bit server
Donwload CRRedist2005_x86.msi from http://www.filewatcher.com/m/CRRedist2005_x86.msi.16971776.0.0.html
After download, double click on it to start the installation.

Once the installation process completed. Browse your website. Here you will be able to view the page with crystal report. You may need to restart the server or IIS if the problem still persist.

==================================================

InsyaAllah, this solution will work seamlessly!

No comments: