Unable to generate a report with SAP Crystal report - c#

I am facing one issue with Crystal reports that I am using to generate a report for my orders in WPF application.
My work station configuration is Windows 7 (Ultimate) 64-bit, Visual Studio 2010.
I have not installed any of the Crystal Report engines but I have copied all the necessary dll's to my project (Created a folder and then referenced in my project).
But when I click the button (button which generates a report), I am getting an exception in the report constructor (different exceptions are coming for different run's).
The main exception says
"The type initializer for
'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an
exception."
When I dig into inner exceptions, I got to know this.
"Could not load file or assembly
'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its
dependencies. The system cannot find the file
specified.":"CrystalDecisions.ReportAppServer.CommLayer,
Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Here is the screen shot of my error,
I have googled it and got to know that I need to install CR for Vstudio 2010, but if I install my development machine, how can I make an installer to deploy in client machine and I don't want to install the CR in all machines (Where I going to deploy to many of my customer's).
I really need an help in solving this, what can I do for this to resolve my issue?
Any help highly appreciated.

Official documentation says:
Deploying Crystal Reports for Visual Studio 2010 (CRVS2010) runtime
files is mandatory in order to ensure that a project containing
Crystal Reports components functions correctly.
Either follow these recommendations, or refuse Crystal Reports usage in your application and choose another reporting engine, which deployment fits your requirements.

Are you using a ClickOnce installation for your application? If so, you can specify SAP Crystal Reports Runtime Engine for .NET Framework as a prerequisite under the project's Publish... properties, so it will install anytime your app installs, it will download and install from the web. If not ClickOnce, your installation method can be configured to install the engine with your app as well. To develop, you need to install CR for Visual Studio.

Related

How to Add the right Crystal Reports dlls in a Visual Studio Project

I need crystal reporting dlls for my c# application. First of all I referenced crystaldecisions.crystalreports.engine , crystaldecisions.shared , crystaldecisions.reportsource , crystaldecisions.windows.forms but this throwed a badImageException of incompatibility. I tried replacing the dlls with 32-bit files as I am using 32-bit client of Oracle so all Project Settings are set to x86. This did not work too. Now I've installed CRRedist2005_x86.msi it installed some assemblies in C:\Windows\assembly\GAC these are CrystalDecisions.Enterprise.Desktop.Report , CrystalDecisions.Enterprise.Framework , crystaldecisions.Enterprise.InfoStore , crystaldecisions.Enterprise.PulginManager,crystaldecisions.Enterprise.Viewing.ReportSource. Should I reference these files instead of the previous ones ?
My OS is 8 x 64. I'm using VS 2013 and Oracle 32-bit client. I've faced and resolved some of compatibility issues till now but now I am unable to figure it out. My aim is to load an xml file and show it to the reportviewer programmatically; for this purpose I'm stuffing my head with dll files. Someone please guide me what should I do ?
You can install SAP CRV to your PC and it will do all the work.
but if you have previously installed an older version after installation open the visual studio and add reference to your solution by selecting installation location dlls.
then check your web.config under assemblies
add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0
it should change the version automatically if not you can change it manually.
also check your report viewer registry it should also changed automatically if not change it manually as follow:
in your aspx page at the top you will find
<%# Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0,

Visual Studio 2008 Setup Project does not include VC_redist

I know this must have been answered before, but I cannot find a reference...
Problem: How do I configure a Visual Studio setup project to include and install the VC redist package?
Info:
I am creating a Visual Studio 2008 C# Win Forms project that uses native code through a managed C++ dll. In order to install this program on users computers, I made a Visual Studio Setup project. The only problem is, I cannot seem to get the x86_redist package to be included in the install, thus, the program fails to launch on users computers who do not have VS. (Yes, this is a Release build.) I have attempted adding a PreRequisite in the C# program, and I have attempted adding a Merge Module in the setup program.
Thanks for the help!
More detail:
The exact error message is this: Exception caught! System.IO.FileLoadException: Could not load file or assembly "MyInterface, Version=1.0.5354.28734, ..." or one of its dependencies. The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem. (Exception from HRESULT: 0x800736B1)
That HRESULT is a COM Exception, and essentially seems to wave its hands and say "Something bad happened". Any hints?

Could not load file or assembly CrystalDecisions.VSDesigner Version=10.5.3700.0

i have a web application with visual studio 2008 and crystal report 2008 and all thing is fine
BUT
when i installed SAP crystal report 2010 , my be it crash with CR 2008
when i run my APP i get this message
Could not load file or assembly CrystalDecisions.VSDesigner Version=10.5.3700.0
i do some solutions
1 - i open web.config file and delete the row of CrystalDecisions.VSDesigner - my app run fine but reports not working
when i add this row again my app not running
please . i do alot of research about this problems but no HOPE
thanks for ur time
In Vs 2003 the Runtime of Crystal reports was bundled in the program setup when you create the installer and installed, but with vs 2005 and later you have to install it.
I think here you can find the msi
http://scn.sap.com/docs/DOC-27917
The dll version of the Runtime that ships with vs is different from the various version of Crystal reports, so you have to install the right one
There's a good chance that installing the new version of Crystal Reports wiped your previous assemblies out of the GAC and replaced them with a newer version. From SAP:
As each version of Crystal Reports has its' own specific runtime which
must be correctly deployed, it is critical that the deployed runtime
be in agreement with the Crystal Reports assemblies for Visual Studio
.NET referenced in your project.
Your error looks like it is trying to find a DLL from Crystal Reports 10.5 and as the above link suggests, it does not like having differing versions of crystal reports running side by side.

How to install Crystal Reports viewer on client machine when client install windows installer

I run the same exe file on another computer, but it gives error. The application works on my pc, but does not work on user's pc. I try to compile the app in other development machine and it is work well, the problem is my app doesn't work on user's pc.
Could not load file or assembly 'CrystalDecision.Shared,
Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'
or one of its dependencies. The system cannot find the file specified.
There is a folder called Microsoft Visual Studio 9.0\Crystal Reports\CRRedist\IA64 in your Programs folder. There you will find a redistributable package. Just add this file to your setup project - user defined actions - and install it.
edit: As you mentioned setupProject CustomActions only allows exe/dll files
I found another solution. Hope this ones satisfies your needs.
Add a mergeModul to your setupProject :
(right-click solution explorer on setupProject, add mergeModul).
A folder called C:\Program Files (x86)\Common Files\Merge Modules should automatically show up. There you may find a file called CrystallReportsRedistxxx.msm.
Add this to your project and it should install too.
BusinessObjects_CrystallReports
MS CrystalReport
Adding Components to the Setup Project
How To Create Setup And Deployment Project With Crystal Report In VS Studio 2008

How to create a .NET setup project with crystal report prerequisite?

I have worked on a desktop application in .net and it uses crystal report for generating report in pdf/ms word. However, I am now trying to deploying this app with visual studio setup project. Now, finding a way to bundle the crystal report assemblies in some way so that they can also install automatically on a pc where crystal report isn't installed. How can I achieve this please?
Regards
There is a folder called Microsoft Visual Studio 9.0\Crystal Reports\CRRedist\IA64 in your Programs folder. There you will find a redistributable package. Just add this file to your setup project - user defined actions - and install it.
edit: As you mentioned setupProject CustomActions only allows exe/dll files
I found another solution. Hope this ones satisfies your needs.
Add a mergeModul to your setupProject (right-click solution explorer on setupProject, add mergeModul). A folder called C:\Program Files (x86)\Common Files\Merge Modules should automatically show up. There you may find a file called CrystallReportsRedistxxx.msm. Add this to your project and it should install too.
To find the right MergeModul for your version have a look at: BusinessObjects_CrystallReports
Adding MergeModul to setupProjects look at: SetupMergeModul
What kind of CrystalReport package to use, look at: MS CrystalReport I and MS CrystalReport II
hth

Categories