Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
.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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 13th, 2004, 10:50 PM
Friend of Wrox
 
Join Date: Sep 2003
Location: , , .
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.
thanks

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"
myTableLogonInfos.Add(myTableLogonInfo)
CrystalReportViewer1.LogOnInfo = myTableLogonInfos
CrystalReportViewer1.ReportSource = myReport
CrystalReportViewer1.DataBind()

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.







Reply With Quote
  #2 (permalink)  
Old April 27th, 2004, 01:41 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
            crTable.ApplyLogOnInfo(crLogOnInfo)

Reply With Quote
  #3 (permalink)  
Old September 7th, 2004, 03:37 AM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to purnachandrarao
Default

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

steps:

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



Reply With Quote
  #4 (permalink)  
Old January 24th, 2005, 02:56 PM
Registered User
 
Join Date: Jan 2005
Location: Hartford, CT, USA.
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
Default

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
            Next


Please suggest

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:56 AM.


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