Wrox Programmer Forums
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 13th, 2004, 10:50 PM
Friend of Wrox
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logon failed.

I am doing crystal reports in asp.net.When i run my .aspx page its giving below error.But When i see the my .aspx page in design mode result displaying correctly.Problem coulb be my code behind my code is like this .
Pl advice me where coulb be the problem.Actually i am doing windows authentication to connect to Sql Server.

Dim myReport = New cr1
Dim myTableLogonInfos = New CrystalDecisions.Shared.TableLogOnInfos
Dim myTableLogonInfo = New CrystalDecisions.Shared.TableLogOnInfo
Dim myConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo
With myConnectionInfo
.ServerName = "mdt"
.DatabaseName = "Accounts"
End With
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTableLogonInfo.TableName = "accmst"
CrystalReportViewer1.LogOnInfo = myTableLogonInfos
CrystalReportViewer1.ReportSource = myReport

Error Message:

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.LogOnExcept ion: 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.

Old April 27th, 2004, 01:41 PM
Registered User
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Hope this helps:

 Dim connInfo As New ConnectionInfo()

        Dim crDatabase As Database
        Dim crTables As Tables
        Dim crTable As Table
        Dim crLogOnInfo As TableLogOnInfo

        crDatabase = objReport.Database
        crTables = crDatabase.Tables

        For Each crTable In crTables
            With connInfo
                .ServerName = "SERVER"
                .UserID = "USERID"
                .Password = "PASSWORD"
            End With

            crLogOnInfo = crTable.LogOnInfo
            crLogOnInfo.ConnectionInfo = connInfo

Old September 7th, 2004, 03:37 AM
Registered User
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to purnachandrarao

hi friend
this code definitely works for u
 U need to do is


1) when u r designing report select database source as odbc or oledb as u wish specifying userid and password and other details it asks

Now the report will be ready

2)Put a crystal report viewer on the web form
3)double click on crystal report viewer

dim objectname as new crystalreport1()

 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        objectname.SetDatabaseLogon("userid", "password")
        crystalreportviewer1.ReportSource = objectname
        crystalreportviewer1.Visible = True

    End Sub

This code works for u fine with out any problems

Old January 24th, 2005, 02:56 PM
Registered User
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to SandeepDhawan Send a message via MSN to SandeepDhawan Send a message via Yahoo to SandeepDhawan

Even I am facing the same problem and solution suggested here is not the solution I am looking for.
I have my application connect to the SQL Server using Integrated Security; in this my application gives me an error "Invalid table number" and my code is as below:

            For inCtr = 0 To pobjReportObject.Database.Tables.Count - 1
                'Assinging Parameters
                crLogonInfo = pobjReportObject.Database.Tables(inCtr).LogOnInfo
                crLogonInfo.ConnectionInfo.ServerName = Framework.Classes.clsAppSettings.fnGetSetting(modC TConstants.CONST_REPORT_SERVER, Framework.Classes.clsFrameworkConfigs.enumSections .AppSettings)
                'crLogonInfo.ConnectionInfo.UserID = Framework.Classes.clsAppSettings.fnGetSetting(modC TConstants.CONST_REPORT_UID, Framework.Classes.clsFrameworkConfigs.enumSections .AppSettings)
                'crLogonInfo.ConnectionInfo.Password = Framework.Classes.clsAppSettings.fnGetSetting(modC TConstants.CONST_REPORT_PWD, Framework.Classes.clsFrameworkConfigs.enumSections .AppSettings)
                crLogonInfo.ConnectionInfo.DatabaseName = Framework.Classes.clsAppSettings.fnGetSetting(modC TConstants.CONST_REPORT_DATABASE, Framework.Classes.clsFrameworkConfigs.enumSections .AppSettings)
                pobjReportObject.Database.Tables(inCtr).ApplyLogOn Info(crLogonInfo)
                pobjReportObject.Database.Tables(inCtr).Location = crLogonInfo.ConnectionInfo.DatabaseName & ".dbo." & crLogonInfo.TableName

Please suggest

Similar Threads
Thread Thread Starter Forum Replies Last Post
logon failed serdarbyktmz Crystal Reports 0 April 18th, 2007 10:22 AM
LogOnException: Logon failed leoluvis Crystal Reports 0 February 7th, 2006 05:31 AM
Logon Failed! VannAustin BOOK: Professional Crystal Reports for VS.NET 0 March 3rd, 2005 05:13 AM
logon failed Rohit Ranjan Crystal Reports 1 February 28th, 2005 06:19 PM
LOGON FAILED! winnie1778 Crystal Reports 1 January 25th, 2005 04:28 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.