序
在 .net application 上運用 Crystal Report
全攻略在此
https://pages.community.sap.com/topics/crystal-reports/visual-studio
今天只說在win11 上遇到的問題
Crystal Report win11 Compatibility 相容性
海豚的win11 是24H2
首先 Crystal Report 要升到 SP 37 或更加新版本
見下圖
然後,海豚試到 win11 print dialog有問題
遇到的問題
假設report有1-10頁
Print 2-3 ok
Print 全部 ok
print 第2頁, 最終只會print第1頁
print 第3頁, 最終只會print第1頁
了解和分析問題
整個 .net application 用 Crystal Report Print 東西的流程如下
Crystal Report Preivew 是按照windows的Default Printer 的 Print preferences
在Crystal Report上按print後,卻會交給 windows print dialog
所以workflow推斷如下
.Net application > Crystal Report runtime > Win Default Printer (Print preference) > Printer Driver > Crystal Report Preview > Print (Win Print Dialog) > Printer Driver > Physical Printer
海豚在用VS2019 + Crystal Report SP27
按照 Crystal Report for VS,用到就算了
沒有一直追版本
大家可以留意一下新版本 fix 了什麼,再決定要追到什麼版本https://help.sap.com/docs/SUPPORT_CONTENT/crystalreports/3354091173.html?locale=en-US
試過
海豚在舊電腦win10上試過,沒有發生以上bug
在win11上
更新printer driver 版本,無法解決
更新Crystal Report 到 SP33, 37, 39,無法解決
解決方法(臨時)
run regedit
go to 電腦\HKEY_CURRENT_USER\Software\Microsoft\Print\UnifiedPrintDialog
add DWORD with
name: PreferLegacyPrintDialog
value: 1
AI reference
後續處理
但見那路徑是current user所以只算暫時解決方案
可能可以透過win server group policy 落條policy給全部人
或 任何AD user登入時都會tigger 自動加入那值到regedit
其次是programmatically 加入那值到regedit
前提是如果user 執行的.net application 時有admin right
或 programmatically overright Crystal Report Print behavior
https://gist.github.com/dolphinotaku/c2f12537a236872a2b3a85be44ddf783
那個海豚沒有去試,估是改完後,在不動regedit的情況下
crystal report按print 可以跳出舊print dialog
AI reference
碎碎怨念
跳到結論,垃圾 win11 / 垃圾 Crystal Report
用臨時方案先撐一會
執屎隊大隊長很忙,要趕去處理其它屎
Reference
Downloads for SAP Crystal Reports, SAP Crystal Presentation Design and SAP Crystal Dashboard Design
https://origin.softwaredownloads.sap.com/public/site/index.html
SAP Crystal Reports for Visual Studio (.NET)
https://pages.community.sap.com/topics/crystal-reports/visual-studio
Crystal Reports, Developer for Visual Studio Downloads
https://help.sap.com/docs/SUPPORT_CONTENT/crystalreports/3354091173.html?locale=en-US
SAP Crystal Reports, version for Microsoft Visual Studio Supported Platforms (PAM)
https://www.sap.com/documents/2016/06/f871031e-757c-0010-82c7-eda71af511fa.html
No comments:
Post a Comment