Click here to Skip to main content
13,147,812 members (42,987 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Logon failed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[LogOnException: Logon failed.]
.F(String  , EngineExceptionErrorID 
.A(Int16 , Int32 )
.@(Int16 )
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext)
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext)
CrystalDecisions.Web.ReportAgent.u(Boolean N)
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)

what may be the solution??
Posted 13-Feb-13 1:54am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

this problem may come if your Server Name / Database Name is different from what u have selected at design time

To solve this problem-
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Public Shared Sub Sub_CRCrystalLogon(ByRef rpt As CrystalDecisions.CrystalReports.Engine.ReportDocument)
''CrystalReport1' must be the name the CrystalReport
Dim crTableLogOnInfo As TableLogOnInfo = New TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo = New ConnectionInfo
'Crystal Report Properties
Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
'Then, use following code sample to add the logic in the Page_Load method of your Web Form:
crConnectionInfo.ServerName = Server Name
crConnectionInfo.DatabaseName = DataBaseName
crConnectionInfo.UserID = DBUserID
crConnectionInfo.Password = DBPassword
crDatabase = rpt.Database
crTables = crDatabase.Tables
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
End Sub

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100