Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello everyone,

I am developping a windows application using C# and a sql server data base. I have come to the last step of my developpement, where I have to include reports. So the problem in when I try the crystal report in my machine it works perfectly, and displays the results wanted, but when I publish the app an employ it in the client machine, it triggers this error :

CrystalDecision.CrystalReports.Engine.ReportDocument.cctor()


I have added this dlls :
CrystalDecision.crystalReport.engine;
CrystalDecision.ReportSource;
CrystalDecision.shared;
CrystalDecision.Windows.Forms;
CrystalDecision.web;
Microsoft.reportViewer.Common;
Microsoft.ReportViewer.WebForm/WinForms;


And using this code to call the report

C#
ReportDocument cr = new ReportDocument();
            cr.Load(Path.Combine(Application.ExecutablePath, "REPORT", "horsEtude.rpt"));
                
            cr.SetDataSource(o.dt);
            crystalReportViewer1.ReportSource = cr;
            crystalReportViewer1.Refresh();

the REPORT folder is in the BIN/DEBUG folder

I have changed copyLocals to True

the version of my DLLs is 13.0.2000.0 and I am using Visual stuio 2010

I have tried a million solution, but still triggers that exception
I also instal Microsoft ReportViewer 2010 Redistibuable and Microsoft .NET 4.6
Framework in the client machine

The publish method that I use is that I create a Setup Project, I add my existing project, and I a a project output, I build the solution and copy the setup.exe from the ebug folder.

Please I need your HELP, I have tried every possible tutorial on the web, but still no chance.

I hope I explained the issue clearly. Thank you

What I have tried:

A million tutorials throughout the web
Posted
Updated 25-Feb-16 6:00am
v2

Quote:
I also installe Microsoft ReportViewer 2010 Redistibuable and Microsoft .NET 4.6
Framework in the client machine


did you install crystal runtime on the client machine?

CRforVS_redist_install_32bit_13_0_8 or CRforVS_redist_install_64bit_13_0_8
 
Share this answer
 
v2
After reaing your comment, I have installed it in my client's machine, the error has gone you are so amazing !

But it shows this error
C#
failure of the report loading


As I already said, my .rpt file is in the bin/Debug/REPORT file. So I guess now that the error comes from not being able to find where my Rpt file is.

I appreciate your Help, thank you so much
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900