[Crystal Report] 解決 WPF 中 Report Failure to load 問題

當利用Crystal Report 開啟 report 時, 有時會彈出以下錯誤訊息:

"A document processed by the JRC engine cannot be opened in C++ stack"

產生這種情況, 通常兩個原因.

若叫用時若它是以外來檔案方式的話, 則需要確定rpt 檔build 完後是否存在. 預設下為Embed resources. 若要解決, 則須要進行以下設置:

  1. 將Action 改為 Content;
  2. 將Output Directory 改為 Copy Always;

而叫用時則需要指向project 中的路徑.

另一種情況則常見於以Class 型式叫用report, 原因是第二次叫用時沒有執行Dispose(), 再次開啟令其throw exception. 解決方法則是於再叫用前確定已經執行Dispose() 便可.

About C.H. Ling 262 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.