Crystal Report: Unable to connect incorrect log on parameters
Asked Answered
V

6

14

When printing a report, the user sometime have the following error:

CrystalDecisions.CrystalReports.Engine.LogOnException:  
Error in File C:\DOCUME~1\carolec\LOCALS~1\Temp\temp_b117cc2e-c184-4556-a493-e04e6d4126fb {388C2B55-114E-4087-A22D-9289902AFDEB}.rpt:  
Unable to connect: incorrect log on parameters. ---> System.Runtime.InteropServices.COMException (0x8004100F): 
Error in File C:\DOCUME~1\carolec\LOCALS~1\Temp\temp_b117cc2e-c184-4556-a493-e04e6d4126fb {388C2B55-114E-4087-A22D-9289902AFDEB}.rpt:
Unable to connect: incorrect log on parameters.
   à CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext)
   à CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
   --- Fin de la trace de la pile d'exception interne ---
   à CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
   à CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
   à CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
   à CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)

Any ideas on a solution?

Configuration: C# (2008), WinForm, Crystal Report 10, SQL Server 2008 Express (local)

Vibraharp answered 6/7, 2009 at 14:59 Comment(0)
C
13

Haven't used Crystal Reports for a bit, but generally an error along the lines of "LogOn Exception" may actually have nothing to do with security at all, Crystal Report errors can be a bit random.

Its possible it may be an error related to memory issues.

Or...

It might be report specific, a sub-report maybe trying to logon using credentials stored within the report, rather than the credentials you've passed into it via the code; You need to loop through all sub-reports rather than just the main report setting the login information.

I remember having this particular error when I used a workaround to install a dynamic logo for a report (that got pulled from a binary field within another database table) except there was a slight error in which it pulled the logo data for each row of data; After a certain amounts of rows returned it died resulting in a similar error.

Crankcase answered 6/7, 2009 at 15:35 Comment(2)
Thanks. I think I located the problem. The name of the datasource of a subreport had a casing mismatch.Vibraharp
Dear Phil.. I dont know how to Thank you. I used this tip and fixed my problem after spending 4 hours on it. Thanks a million.Conventioner
V
13

For anyone having the same problem, also check if your report's Datasource provider is "SQL Native Client". If yes, this wont work in your Production server which doesn't have SQL client installed. It has to be "SQLOLEDB" for it work in machines where there is no SQL client installed.

This was the reason why my report worked on my test server(which had SQL server client) and did not work in my production server

Valedictorian answered 17/6, 2016 at 16:11 Comment(3)
This was the problem for me. Crystal Reports was set up to use SQL Server Native Client (SQLNCLI11) as the data provider. It was not installed on the server which was trying to process reports. You can tell if it is installed by looking for "sqlncli11.dll" in C:\Windows\System32 and C:\Windows\SysWOW64. The actual installer download is hard to find, it is here, buried under the "Install instructions" section about half way down. microsoft.com/en-us/download/confirmation.aspx?id=29065Elisabetta
We had a mix of Crystal Reports using SQLOLEDB (a.k.a. "Microsoft OLE DB Provider for SQL Server") and MSOLEDBSQL (a.k.a. "Microsoft OLE DB Driver for SQL Server") as their Provider. They both worked fine on our localhost, but when we deployed to another environment, the ones with MSOLEDBSQL threw this error. We figured the drivers were either not installed or corrupted, so we switched all reporting to use SQLOLEDB for consistency across all Environments. Thank you for helping us figure this out!Jetton
In fact, that was the problem for me. Strange that the error message says nothing about sqlncli11.dll.Chronograph
E
3

I have same problem but has solved.

The problem is in odbc connection. Just install SQL native driver to add connection in odbc. Download link https://support.fotoware.com/hc/en-us/articles/208664385-Microsoft-SQL-Native-Client-fails-to-download-during-FotoWeb-setup

Economizer answered 23/8, 2016 at 5:0 Comment(0)
P
0

If you have had a report that used to work fine, but then suddenly stopped working... AND you are using SQL Server Authentication... check your Password Expiration date on the Login Account. :)

Petal answered 27/1, 2018 at 1:44 Comment(0)
N
0

For me I created a new instance for a wrong report object. The problem is solved when I changed to correct one. It wasn't related to connection.

NewVehicleLicense report = new NewVehicleLicense();
report.SetDataSource(vehicleLiceseData);
Nimbostratus answered 27/9, 2021 at 9:4 Comment(0)
A
0

In my case it was that I had two connections in the report by accident. You can go to Database->Update Connections on the main page to see if you have more than one.

Arriaga answered 20/2, 2023 at 18:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.