Click here to Skip to main content
15,939,960 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Team,

I am trying to view report using Crystal Report Viewer version 10 in c# after i hosted my web application in server.

am getting following error event though i added the dll files in bin folder.

//added name spaces
string pdfPath;
string pdfpath = Server.MapPath("\\KSADSRWeb\\Reports\\");
pdfPath = pdfpath + "OverAll" + ".pdf";
DataTable TargetReport = new DataTable();
string date = txtCalander.Text.ToString();
string appPath = HttpContext.Current.Request.ApplicationPath;
ReportDocument crystalReport = new ReportDocument(); //throwing below error. 
TargetReport = GetTarget("usp_Targetvsachivement_Modified", date);
CrystalReportViewerTraget.ReportSource = crystalReport;

System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> System.IO.FileNotFoundException: Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 8007007e The specified module could not be found. (Exception from HRESULT: 0x8007007E).
   at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()
   --- End of inner exception stack trace ---
   at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
   at Reports.BtnSubmit_Click(Object sender, EventArgs e) 

Please help me out i already spent couple of days to solve the issue.
Updated 13-Oct-14 23:19pm
NaibedyaKar 14-Oct-14 7:36am    
Hi there, I think crystal report is not setup properly at your server. We need to add some references, create virtual directory and all. If you have installed the crystal report then things must have been setup properly. Can you please confirm.
j snooze 14-Oct-14 18:00pm    
If the above file is a COM interop dll and not a .NET assembly you can try adding it through the COM+ Services under Administrative tools on the Web server. Of course it may have other dependencies that continue to break so installing Crystal if you haven't would be the best option.

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