Jan Schreuder on .Net

.Net code samples, experiences, observations

View my professional profile on LinkedIn

Recent Posts

Tags

News

  • Inappropriate comments will be deleted at my discretion.

    The information and code samples in this weblog is provided "AS IS" without warranty of any kind, either expressed or implied, including but not limited to the merchantability and/or fitness for a particular purpose.

Community

Email Notifications

Tool suppliers

Tools

General

Microsoft

Favorite blogs

Archives

Deploying applications that use Crystal Reports for .Net

I know, for a lot of Microsoft developers Crystal Reports (CR) is a no-go area. But I know that a lot of developers are using it, whether they like it or not. Because of my posts about CR, and more specifically my CrystalHelper class, I'm asked how to deploy applications that use the free version of CR that is shipped with various versions of Visual Studio.

This information is already available at support site for CR. In this post I will post links to that documentation as a reminder to myself, but also to help others that need help when deploying CR to client or server machines.

Register your version of CR

Although you are allowed to freely distribute the CR engine that is supplied with Microsoft Visual Studio, you still need to register that version. To do so, simply add a report to your application. CR will check if registration has already taken place. When this is not the case, CR will ask if you wish to register. Just follow the steps and registration will take place. Registration is free!

Register yourself as a CR developer at Business Objects

An important source of information for everyone using CR, as a developer or a report designer, is the Diamond Technical Community web site. When you register here, you get access to all the documentation available on CR. Most of the information I will link to in this post can be found here, the downloads for Merge Modules and Service packs.

CR as part of a VS 2002/2003/2005 project

For Visual Studio 2002/2003/2005, you are required to use merge modules. The current version of these modules can be found here:

These downloads contain a number of merge modules. Which module is required for your setup depends on the reports you are deploying. A very comprehensive document that explains which modules to add and how to do so when you use Visual Studio 2002/2003 can be found here. Documentation on how to use the merge modules in Visual Studio 2005 is enclosed in the download of those merge modules.

CR as part of a VS 2008 project

The version of CR distributed with Visual Studio 2008 is actually the same as the one distributed with Visual Studio 2005. So for that version, simply follow the instructions for that version.

Building a redistributable package for VS 2005

For applications built with Visual Studio 2005, it might also be a good idea to have a Runtime Package as a custom action or a pre-requisite in your setup. There are some reasons for this:

  • In a network environment, these packages can be pushed by the network administrator
  • The embedded merge modules force you to rebuild the setup for your applications if you want to take advantage of fixes or service packs
  • The runtime package is not part of your setup and can be deployed once, rather than each time your application is installed.
  • Since the setup it is significantly smaller when the merge modules are omitted, the download of your setup takes less time.
  • Setup of your application is faster as it doesn't have to install the merge modules.

CR however does not provide redistributable packages for this version (or for Visual Studio 2002/2003) so I created one myself for use in my current project. For those interested, I followed this easy steps:

  1. Once you have downloaded the merge modules for Visual Studio 2005, extract the file CrystalReports2005_x86 to the folder C:\Program Files\Common Files\Merge Modules
  2. Create a new Setup project and name it RedistCrystalReports2005_x86
  3. Right-click the project name in the solution explorer and select Add -> Merge Module...
  4. Select the merge module CrystalReports2005_x86.msm file from the dialog box
  5. Build the project

And you're ready. A redistributable for CR reports to support the applications you build using Visual Studio 2005 and Visual Studio 2008.

I'm sure this can also be done for Visual Studio 2002/2003 but I have not been able to test that. But the steps would be similar, with the exception of license information which is required for these versions of Visual Studio.

Comments

David said:

Destroying applications? Interesting..

# May 14, 2008 11:26 PM

deploying a project in visual studio 2003 said:

Pingback from  deploying a project in visual studio 2003

# May 30, 2008 10:35 PM

Joe said:

I am deploying a VS 2008 C# application, using Crystal Reports 9. Do I still use the VS 2008 merge modules, or should I use something else???

Is it worth it to convert to CR Basic for VS 2008???

# June 3, 2008 6:22 PM

veljkoz said:

If you are using Crystal Reports for Visual Studio 2008, in order for your application to work when you deploy it, the most simple way to do it is to install on client computer the "Crystal Reports Basic for Visual Studio .NET 2008" msi package - see support.businessobjects.com/.../runtime.asp

After it installs, applications can use CR... very painless, and no need to use the merge modules

# June 17, 2008 11:42 PM

Jan Schreuder said:

That is correct.

# June 18, 2008 8:59 AM

Arun Sabat said:

Download merge modules for VS2005 link is not working.

The businessobject site redirects mr to

www.businessobjects.com/.../default.asp

Can you please give me the latest link to download merge module for VS2005

# July 31, 2008 9:09 AM

Jan Schreuder said:

The people from SAP have changed the entire website, so the links don't work anymore. Please check this link for updates: bloggingabout.net/.../need-help-with-crystal-reports-look-here.aspx

# July 31, 2008 11:55 AM

Nancy Forbes said:

I was able to deploy a report in a .NET 2003 project.  There were some issues with the graphic images and since we are upgrading to VS 2008 in a month I went ahead and downloaded VS 2008 eval early.  I ran the redistributable msi on my development web server but I'm getting 'OBJECT REFERENCE NOT SET TO AN INSTANCE OF AN OBJECT' error on the report.  In my 2003 project I had to create a virtual directory that pointed to the Crystal dll's. to resolve this.  I've tried that on my 2008 project but no joy.  I've problaby have named the virtual wrong as I can't find any documentation for 2008.  I found the 2003 documentation here:  boc.sdn.sap.com/.../235   Ideas?

# August 6, 2008 11:16 PM

Jan Schreuder said:

I have no idea. My best guess is to post this question either in the sap Crystal Reports forum (for links see here: bloggingabout.net/.../sap-is-annoying-me.aspx) or in the Microsoft Crystal Forum: forums.msdn.microsoft.com/.../threads

# August 7, 2008 8:34 AM

Nancy Forbes said:

This is how you deploy Crystal to a Web Site with Visual Studio 2008.

1.Install the CRRedist2008_x86.msi on the web server

2.You will also need to copy a directory and its contents from your computer to the root web of any web site that you create Crystal Reports in.  On my computer this directory was located at:  C:\Inetpub\wwwroot\aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer4  You will need to copy it in the aspnet_client\system_web\2_0_50727 folder of the root web you are installing the Crystal Report application.  See forums.asp.net/.../992330.aspx for additional information - this fixes problems with the Crystal Toolbar.

3. When you create a report within your asp.net application, it will not publish by default.  You need to change the properties on the report.  I haven't experimented a lot with these but changing the Build Action to "Content" and the Copy to Output Directory to either "Copy on Newer" or "Copy always" worked for me.  

4.  I also experienced fewer problems if when I published, I chose to Delete existing files.

The following VB code sample is provided for anyone else who is struggling with passing parameters via a querystring.  This is much simpler than most of the examples that I found on the net.

Imports CrystalDecisions.Shared

Imports CrystalDecisions.CrystalReports.Engine

Partial Public Class myASPNETPAGE

   Inherits System.Web.UI.Page

   Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

       Dim myReport As New TheReportName

       myReport.Load(Server.MapPath("TheReportName.rpt"))

       myReport.SetParameterValue("@Par1", CInt(Request.QueryString("P1")))

       myReport.SetParameterValue("@Par2", Request.QueryString("P2"))

       'Connection Info

       Dim myConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo

       Dim myTableLogOnInfo As New CrystalDecisions.Shared.TableLogOnInfo

       Dim myDatabase = myReport.Database

       Dim myTables = myDatabase.Tables

       Dim myTable As CrystalDecisions.CrystalReports.Engine.Table

       myConnectionInfo.ServerName = "DatabaseServer"

       myConnectionInfo.DatabaseName = "Database"

       myConnectionInfo.UserID = "UserAccount"

       myConnectionInfo.Password = "Password"

       For Each myTable In myTables

           myTableLogOnInfo = myTable.LogOnInfo

           myTableLogOnInfo.ConnectionInfo = myConnectionInfo

           myTable.ApplyLogOnInfo(myTableLogOnInfo)

       Next

       CrystalReportViewer1.ReportSource = myReport

   End Sub

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

   End Sub

   Protected Sub CrystalReportViewer1_Init(ByVal sender As Object, ByVal e As EventArgs) Handles CrystalReportViewer1.Init

   End Sub

End Class    

# August 15, 2008 12:08 AM

Henry said:

i was able to deploy CR in VS .Net 2003, but also have

got another problem. the export, print, and other CR View toolbar doesn't appear corectly. the condition was:in my form i'm using tab control that have view tabpage and there's a CR view for each tab page...it doesn't happen before i deploy it...why is it possible...ideas???????????

# August 27, 2008 5:59 AM

Jan Schreuder said:

Is it an ASP.Net of WinForms application

# August 27, 2008 9:18 AM

Nikhil Joshi said:

The download link for VS2005 and CR12 Redist is as follows.

websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm

You might need to register and then download.

# September 12, 2008 11:14 AM

Arun said:

How to pass?

# December 18, 2008 7:49 AM

Jan Schreuder said:

Pass what?

# December 18, 2008 12:12 PM

Jed Fletcher said:

Hello I have downloaded the Crystal Reports for VS .NET 2005 - Redistributable from the link you provided however i am unable to pass parameters to my reports. Is there any way to fix this

# January 9, 2009 7:58 AM

Jan Schreuder said:

Check my Crystal helper class at www.codeproject.com/.../CrystalHelper.aspx or post your problem here: https://boc.sdn.sap.com/ which is the SAP help site

# January 13, 2009 2:06 PM

Arturo said:

I recently read this wich I haven't probed yet:

I have the professional edition of Visual Studio 2008.  After poking around in VS 2008 Setup and Deployment project I found a the following:

1) Right Click on setup project in the solution explorer

2) Click Properties

3) There is a button called "Prerequisites" click it

4) in the list you will find "Crystal Reports Basic for Visual Studio 2008(x86, x64)

5) Check it off

After doing that your project will now include the CRRedist Files.

When you run the install it will install them and everything works fine.

# February 24, 2009 8:04 PM

Arturo said:

Hello: Now I have tested the above steps and It worked fine, all the crystal reports included in the project showed perfectly.

There are a lot of people running the Crystal .msi program separately and even trying to integrate in the setup program manually.

So I thank the author of the above comment: Robert McArthur from MSDN.

# February 24, 2009 9:34 PM

Pat R said:

I am deploying a windows VS 2008 C# app that includes CR and Business Objects 12.0 as well.  I don't understand how this CR and Business Objects 12.0 relationship works, but I'm having a problem.  

I have installed the CR runtimes (tried small version, full version and both together) on the target windows server 2003 server.

When the app consumes the rpt file, the CR app throws an error saying u25azalea.dll is missing.  I find this dll in the Business Objects 12.0 folder on my development machine and try to include it on the deployment but no luck.

I guess Business Objects 12.0 in not a part of any of the CR runtimes, does that mean I need to buy Business Objects 12.0 for every target server?  I have also tried to embedd the CR rpt in the C# app and deploy, same error.

Thx,

# February 26, 2009 8:56 PM

Maran said:

An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to www.businessobjects.com/support for more information.

# April 23, 2009 12:47 PM

rowter said:

I have a winforms application.

When i deploy and run the application, i get error:Report failed to load.

I have the CRRedist2008_X86 on the test machine. What other files do i need to install on the test machine for successfully running the application.

Do i need to install the crystal report runtime on the test machine?

Thanks

# September 2, 2009 4:38 AM

rajeshw said:

I am facing same error as Maran ie. cr working fine on local server but on production side it throws an exception as 'An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to www.businessobjects.com/support for more information.'

any clues for this?

# September 14, 2009 7:02 AM

Jan Schreuder said:

As the message already states, you need to install the CR runtime on the production server. You can download the redistributables for this from the business objects web site.

# September 14, 2009 12:46 PM

Jim Gamble said:

I have tried all of the suggestions that I have found on this topic, and I have had my web provider install the CR runtime on the server, but I still get the error message.  Everything works fine on my computer, but the error occurs when I try it on the server.

Has anyone found any other tricks to solve this problem?

# October 3, 2009 12:00 AM

pawan said:

i created a windows project..but when i need to install it in the client computer i need to intsall the visula studio project setup and crystal report 9.0(manually)...but i need CR 9.0 to get installed with visula studio project setup

# December 23, 2009 6:34 AM

Jan Schreuder said:

You will need to add the merge modules to the setup.

# December 23, 2009 1:17 PM

Jon said:

Regarding:

veljkoz said:  

If you are using Crystal Reports for Visual Studio 2008, in order for your application to work when you deploy it, the most simple way to do it is to install on client computer the "Crystal Reports Basic for Visual Studio .NET 2008" msi package - see support.businessobjects.com/.../runtime.asp

After it installs, applications can use CR... very painless, and no need to use the merge modules

-- A few people complained of not being able to download from the link given.  A quick Google search for "Crystal Reports Basic for Visual Studio .NET 2008" msi pointed to the new address - for those interested:

resources.businessobjects.com/.../runtime.asp

# March 17, 2010 2:37 PM

vps said:

If the CR.msi is installed on the client system ,

do we need to copy the crystal report(.rpt) files to the client computer?

# May 13, 2010 12:03 AM

Imran said:

I am using Visual Studion 2008 and emabaded crystal reports. I installed Crystal Reports Basic for Visual Studio .NET 2008" msi at client machine. Crystal reports which are designed with .Net Objects are working fine but the one which is designed with ADO.Net has problem. When i asked for the report; a dialogue appear and asked for Database credentiols. I passed all credentiols in VS 2008 but it still appears and most disturbing part is that Database Name filed is empty in that dialogue. What could be the problem pease help

# May 19, 2010 10:47 AM

Imran said:

If you are using emabaded cyrsal reports then you dont need to copy .rpt files with your application. you can check this property by right click on the report and go to property and check build action. if it is set to Embadded Resources then you dont need to copy that. I hope it Helps.

# May 19, 2010 10:50 AM

Jan Schreuder said:

The only reason for the dialog to show when you use ADO.Net is that the Database credentials are missing. It could be that you assign the credentials to the report, but you need to assign it to all CR objects in the RPT. Look at my CrystalHelper to see how it is handled: www.codeproject.com/.../CrystalHelper.aspx

# May 19, 2010 2:30 PM

A W said:

Interesting

# June 11, 2010 5:37 PM

Sumit said:

I have my web application on shared server and I have  developed some reports using Crystal report. Also, i think shared server doesn't have crystal report redistributable package installed. As, it is shared a server, we don't have rights to install.

Let me know how we use crystal reports on the shared server.

Thanks in advance!

# July 8, 2010 1:28 PM

Shail_TheRock said:

I copied the windows application, created with VS 2003 & CR, to another system (as the HD needed a format). Previously the application was working fine at my system as-well-as at client's end. Now, the CR is asking for the registration key (at my end) & CR is not running at client's end??? Although, all the merge modules were referenced & added in the previous version (before copying) are also available in the copied version.

What should I need to do? Recreate the reports???

# July 14, 2010 2:40 PM

veena said:

crystal reports are executing on local machine

when it is deployed in server machine reports are not executing it is giving white blank page.How to solve the issue

# May 23, 2011 6:56 AM

Pavithra said:

i have a windows project which is developed in vs 2003 and crystal reports ,that setup was working fine even in client. As the there is a need to make some changes i have used vs 2005. i am not able to find 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  but i have added cystal reports for vs 2005 in prerequisites but when i run that package, it is saying report can not be loaded.

Please help me, its urgent........

# May 27, 2011 12:15 PM

santosh said:

Is CRRedist*.msi required license to deploye in client machine.

# June 24, 2011 9:58 AM

santosh gurav said:

i have installed visual studio 2008!

but crystal reports are not installed whithin that setup . then what I will do for that ?

and mobile controls are also not installed on my pc then any one please tell me !

# October 1, 2011 8:43 PM

clifford Sutton said:

Ok I will try to explain.  I am using vb.net 2005 and have a registered copy of cr XI sp2   in studio my code works fine but if I deploy it the software works but when I go to print  it actually does print but then the software stops and telling me that the program has stopped and click to continue.  I deploy it with the redist2005_x86  as the computer is 32 bit.  but no matter what I do it does not work.  Is there a place I need to insert my keycode ?  If there is I cannot find it.  The deploy and software work fine on xp machines. Just windows 7

# October 13, 2011 9:53 PM

San said:

I have a major problem with CR v 10.5.3700 on Windows Server 2008 64 bit machine. We have a web site created in VS 2008 and CR is making use of v 10.5.3700. Locally everything works fine, able to generate the report.When i tried coping the dll's after publishing the website onto the WIn  2008 server, installed CR redistributable for 64 bit os. Its throwing me the following error.

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

Could you please help meeeeeeeee ?? I have googled to death....

# October 14, 2011 6:25 PM

P. Belter said:

I know why I have the problem, not sure how to find what I may have missed. Here are the events;

1) Developed application in VS2005. Deployed in Sept. 2006.

2) Upgraded CR to 2011 to get the enhanced report development.

3) Performed all required steps to update rpt's and viewer forms.

4) Optained the runtime required CRRuntime_12_1_mlb

5) Rebuilt, published and installed on existing client machines along with the runtime. All works fine.

6) Several new machines required the application so did the same with those. However when the client opens the viewer form, the parameter prompt window throws exceptions left and right. Continuing on gets you to the window, however date pickers and string text boxes don't look right and each time they type in the text boxes the exeption cycle begins again.

I know I am missing something simple but I have no idea where to begin looking. The difference between the Old clients is they were fisrt installed with a setup and not a published install. So I am starting with comparing the Published Application requirements to the Old set up requirements. Any other Ideas would be greatly appreciated.

# February 24, 2012 3:53 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 4 and 8 and type the answer here: