問題現象
- 安裝
CRforVS_13_0_14,但引用屬性顯示版本 13.0.2。
- 報表運行時依賴 .NET Framework 2.0,需升級至 4.0。
原因與解決
1. 版本顯示不一致
- Crystal Reports 運行時與設計時組件版本號可能不同。
13.0.2 是組件元數據版本,13.0.14 是安裝包版本,屬正常現象。
- 在專案引用中檢查
Specific Version = False,確保綁定最新運行時。
2. 升級至 .NET 4.0 運行時
- 下載並安裝 Crystal Reports for Visual Studio 2010/2013/2015/2017/2019/2022 對應版本(官方 SAP 下載頁)。
- 專案屬性 → Target Framework 設為
.NET Framework 4.x。
web.config/app.config 確認 <runtime> 綁定重定向:
<dependentAssembly>
<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.2000.0" newVersion="13.0.2000.0" />
</dependentAssembly>
3. 常見坑點
- 部署伺服器需安裝 CR Runtime 64-bit/32-bit(與 IIS 應用程式池位數一致)。
- 報表檔案
.rpt 複製到輸出目錄(Copy if newer)。
- 資料庫連接字串在代碼中動態設置,避免設計時硬編碼。