Saturday, March 7, 2009

Retrieving the COM class factory for component


Server Error in '/website' Application.
--------------------------------------------------------------------------------

Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 80040154.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 80040154.

Source Error:

Line 272:
Line 273:
Line 274: rpt = new ReportDocument();
Line 275: rpt.Load(Server.MapPath(@"Report.rpt"));
Line 276: rpt.Database.Tables[0].SetDataSource(ds.Tables[0]);

Source File: c:\website\report.aspx.cs Line: 274
  • เหตุเกิดเมื่อจะทำการออกรายงานด้วย crystal report
  • อ่านกระทู้ต่างประเทศลองตรวจสอบ registry ไม่พบในเครื่องลองไปดูที่เครื่องคนอื่น ก็เห็นนะตัวนี้
HKEY_CLASSES_ROOT => CLSID => {11BD5260-15B6-412D-80DB-12BB60B8FE50}
  • เลยนึกว่าเป็นที่ registry เลยลองเอา registry เครื่องอื่นมาลง พอลองรันรายงานก็ error เหมือนเดิม
  • เลยลองลง crystal report runtime ใหม่ ก็แก้ปัญหานี้ได้ครับ
  • แต่ก็งงอย่างนะทั้งที่เครื่องนี้ลง .net studio 2005 แล้วนะ คิดว่าลงไม่สมบูรณ์ เลยทำให้ registry เกี่ยวกับ crystal report มีปัญหา
  • หรือ เจอไวรัสไปแก้ไข หรือ ลบ มันไปก็ไม่ทราบได้
  • หรือ มีใครไปลงเล่น registry ระบบหว่าเนี๋ย

-------------------------------------------------------------------------------
  • หรือ Exception ด้านล่างนี้เหมือนกัน แต่ด้านล่างเนี๋ยแก้โดย restart iis ก็หายแล้วนะ
  • ปัญหาน่าจะเป็นอันเดียวกันกับที่นี่ http://forums.asp.net/t/1045193.aspx
  • อ่านรู้ปัญหาน่าจะเกิดจาก สร้าง report แล้ว close ไม่ได้ หรือ ไม่ได้ close
  • ทำให้ memory ไม่พอ เลยเกิด System.Runtime.InteropServices.COMException: Failed to open report.
  • วิธีแก้ก็ประมาณใช้ collection ช่วยง่ายดี หรือไม่ก็ export เป็น pdf แล้วก็ close report ซะ

Server Error in '/' Application.
--------------------------------------------------------------------------------

Failed to open report.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Failed to open report.

Source Error:


Line 115: {
Line 116: // rpt.Load(@"C:\tklthailand\mlm\InvoiceReport.rpt");
Line 117: rpt.Load(Server.MapPath(@"InvoiceReport.rpt"));
Line 118: }
Line 119:



Solved

Note

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x80004005): The system cannot find the file specified.

  • อีกอย่าง error อันเนี๋ย เป็นของ windows app นะ แต่มี System.Runtime.InteropServices.COMException (0x80004005) : The system cannot find the file specified
  • exception อันเดียวกันแต่ คำอธิบายเป็น cannot find the file specified ไม่ได้เป็น Failed to open report.
  • อันนี้คือ ไม่พบ file.rpt ของ crystal report ^^

Related Posts:

References:

No comments:

Post a Comment

Popular Posts