cancel
Showing results for 
Search instead for 
Did you mean: 

System.Runtime.InteropServices.COMException: Invalid class string

Former Member
0 Kudos

Good afternoon, I created a website in Visual Studio 2005 that generates reports in Crystal Reports in PDF format. On my machine it all works perfectly, but after publishing the website on the server by clicking on the button that generates the report the following error:

Invalid class string

Description: An unhandled exception when you run the current web request. Check the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Invalid class string

Error source:

There has been no exception during the execution of the current web request. Information on the origin and location of the exception can be identified using the exception stack trace below.

Stack trace:

[COMException (0x80004005): Invalid class string

]

CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open (Object & DocumentPath, Int32 Options) +0

CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open (Object & DocumentPath, Int32 Options) +87

CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened () +279

[Exception: Unable to load the report.]

CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened () +340

CrystalDecisions.CrystalReports.Engine.ReportDocument.Load (String filename, OpenReportMethod openMethod, Int16 parentJob) +870

CrystalDecisions.CrystalReports.Engine.ReportDocument.Load (String filename) +73

descargas.traerenvios (String type) +766

descargas.btnenviospdf_Click (Object sender, ImageClickEventArgs e) +11

System.Web.UI.WebControls.ImageButton.OnClick (ImageClickEventArgs e) +105

System.Web.UI.WebControls.ImageButton.RaisePostBackEvent (String eventArgument) +115

System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (String eventArgument) +7

System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, String eventArgument) +11

System.Web.UI.Page.RaisePostBackEvent (NameValueCollection postdata) +33

System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

________________________________________

Information: Release of Microsoft. NET Framework: 2.0.50727.832; ASP.NET Version: 2.0.50727.832

I tried to create a WebSetup with the merge modules for Crystal Reports (CrystalReportsRedist2005_x86.msm) and also adding to the prerequisites installer Crystal Reports, and even installing the Crystal Reports for VS. NET 2005 - Redistributable (CRRedist2005_x86.msi) in the server, but still displayed the same error. Could you help me solve the problem?

Thank you very much, a greeting.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please make sure that you are using the same dlls as the one in the development machine. The dlls should be in c:windowsassembly folder.

Also is this happening with all the reports or one specific report?

[Sample|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/webcontent/uuid/80774579-b086-2b10-db91-ed58c4dda375 [original link is broken]] you might want to try.

Thanks,

AG.

Edited by: AG on Apr 22, 2009 9:51 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I am going with all the report. Anyway I will check the folder c: \ WINDOWS \ assembly.

Thank you very much.

Former Member
0 Kudos

Hi, I have checked the folder c: \ WINDOWS \ assembly on the server, are the necessary dll. I let you here the code I use to run the report, along with references from the web.config assemblies

wsreport.Service wsreport = new wsreport.Service();

DataSet dataset = new DataSet();

DataSet1 ds = new DataSet1();

ReportDocument report = new ReportDocument();

dataset = wsreport.Entregas(12249,"02/01/2009",1);

if (dataset != null)

{

ds.Tables["DataTable1"].Merge(dataset.Tables["envios"]);

report.Load(Server.MapPath("report/CrystalReport.rpt"));

report.SetDataSource(ds.Tables["DataTable1"]);

report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "Informe");

report.Close();

report.Dispose();

}

Like I said before, my pc works fine, the problem occurs when I publish the website on the server and I run the report.

Thank you very much, a greeting

Former Member
0 Kudos

<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

<add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

Former Member
0 Kudos

HI,

Since this is coming in server machine I would suggest you to run [this|http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx] application and see if there are any permission that is denied to the report folder. Also make sure that we can hit the database properly.

I would also suggest you to try one of the sample application or create a simple application to test in the server machine.

Regards,

AG.

Former Member
0 Kudos

Hello, I'm going to do a series of tests by which I commanded you. When I have results I will inform you.

Thank you very much for everything, a greeting

Former Member
0 Kudos

Hello, in the end I opted to use visual 2005 report, because I was in a hurry to be able to print reports on the web.

Thank you very much anyway.