views:

4316

answers:

4

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)

+1  A: 

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.

Phill
Thanks. I think I located the problem. The name of the datasource of a subreport had a casing mismatch.
izokurew
A: 

I'm having the same issue, I even created a routine to loop through all the subreports and passing the logOn info, but the thing is that i'm passing all the data to the report with a dataset.

When I try this out separated from my aplication, it works, but after integrating it to my solution, it fails. I don't know what else to do.

anyulled
A: 

i am using crystal report v10, with sql server 2008. i filled in the server name but i cant find any databases.. i dont any have login name and password. but when i am using sql 7, using the same fill in data i connect to the database. i have problem only in connecting sql server2008

elbren antonio
A: 

yo tenia el mismo proble con los sub reporttes y esto lo solucione validando los datos del reporte contenedor, es decir verificando que el reporte contenedor estubiera enlazando bien los datos.

rodrigo