on 2024 Nov 27 4:37 PM
I'm using Crystal reports runtime 33 in ASP.NET for the first time, last version that we used was 21. The reports connection it's with SQL Server and the code used:
Dim cnnInfo As CrystalDecisions.Shared.ConnectionInfo = New ConnectionInfo() With cnnInfo .ServerName = "(local)" .DatabaseName = "MYDB" .IntegratedSecurity = True End With Call SetDBLogonForReport(cnnInfo, fCR) Call SetDBLogonForSubReport(cnnInfo, fCR)
The problem is that Crystal Reports always tries to connect to the database using the IIS Application Pool identity instead of the impersonated user. Impersonation doesn't work.
Runtime versions from (SP21) to (SP25) works fine.
Impersonation doesn't work for report with Crystal Reports (sp26) and higher.
Does anybody knows why? What I need to change to impersonation works?
Request clarification before answering.
Always use the latest SP for CR for VS, currently it's SP 36, this is too use all of the latest Security updates and OS updates, you can get it from here:
https://help.sap.com/docs/SUPPORT_CONTENT/crystalreports/3354091173.html
See this post for possible fix:
https://stackoverflow.com/questions/50993108/impersonation-in-crystal-reports
Check your Web.config file and look for more than one, it could be IIS is using one other than the one specified in your app folder.
You also must use Sessions and PostBack to keep the report in focus, see this KBA:
https://userapps.support.sap.com/sap/support/knowledge/en/1985571
And have a look at this Blog I wrote when upgrading to current versions of CR for VS:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.