Web Report keeps asking for username and password

I have a report that is from 1 database, that has 4 tables.  The login is the same for all.  I run this report on my local and it works fine, when I run on the production web server, it comes back and this what it looks like
 servername 10.10.10.44,8433)
database name:
User name: sa
Password: ***********

I've been working for over a day now and cant figure it out.  I've attached the code.  Again it works on my developement machine no problem

Protected Function PrintMakeReady() As Boolean
        Dim rd As New ReportDocument
        Dim rptDS As New DataSet
        Dim rptDS2 As New DataSet
        Dim myCmd As New SqlCommand
        Dim da As New SqlDataAdapter
       

        Dim myfilelocation As String = Server.MapPath("../Reports/MakeReadyReportWeb.rpt")
        'Try

        rd.Load(myfilelocation)
        rd.SetParameterValue(0, mWO_Number)
        rd.SetDatabaseLogon("sa", "sh4207", "10.10.10.44,8433", "AptGalleryInspections")

        Dim mSelection As String = ""
        Select Case mSubtype
            Case Is = "1"
                mSelection = "{MakeReadyMaster.WO_Number}={?WorkOrderNo} and ({MakeReadyDetails.PreInspect})=true "
            Case Is = "2"
                mSelection = "{MakeReadyMaster.WO_Number}={?WorkOrderNo} and ({MakeReadyDetails.Condition}<>'Satisfactory' and {MakeReadyDetails.Condition}<>'N/A' and {MakeReadyDetails.Condition}<>'Incomplete')"
        End Select
        rd.RecordSelectionFormula = mSelection
        Dim logon As New TableLogOnInfo
        Dim tbl As Table
        For Each tbl In rd.Database.Tables
            logon = tbl.LogOnInfo
            logon.ConnectionInfo.ServerName = "10.10.10.44,8433"
            logon.ConnectionInfo.DatabaseName = "AptGalleryInspections"
            logon.ConnectionInfo.UserID = "sa"
            logon.ConnectionInfo.Password = "sh4207"
            tbl.ApplyLogOnInfo(logon)
        Next

        CR1.ReportSource = rd

Open in new window

mgmhicksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
You need to loop through the tables and assign the login info
http://forums.asp.net/t/1206308.aspx/1

FYI, you should mask the password in your code as well.



0
Kyle AbrahamsSenior .Net DeveloperCommented:
0
mgmhicksAuthor Commented:
ged325 when you look at my code,  I think I am already looping through the tables.   I will check out the connection.type idea.

thanks
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

CrashmanCommented:
Imports CrystalDecisions.Shared

     For Each connection As IConnectionInfo In Rpt.DataSourceConnections
            connection.SetConnection(server, base, user, pass)
     Next
0
mgmhicksAuthor Commented:
Crashman, when I do this do I get rid of setting connection info for all the tables? Thanks for helping
0
CrashmanCommented:
All the tables?, you maybe wish say connections, and if you take a look, you will see this code is for each connection , this code change all the CONNECTIONS,
I had the same problem some months ago, and as you, I had test the same code exactly and dont work, and with this, is solved
0
mgmhicksAuthor Commented:
Crashman, tried that works on local developement, but not on web server?  When it asks for username and info the database portion is blank, but it will only let you change the username or password.  What could be different?  I also have a couple of other reports that were already on the site, use same technique and they still run fine.  Totally frustrated!
0
CrashmanCommented:
this are not completely safe spaces, you tried to trim
0
mgmhicksAuthor Commented:
Not sure where arent safe spaces?.  I did attach what its asking me and a copy of current code.

Dim rd As New ReportDocument
        Dim rptDS As New DataSet
        Dim rptDS2 As New DataSet
        Dim myCmd As New SqlCommand
        Dim da As New SqlDataAdapter
       

        Dim myfilelocation As String = Server.MapPath("../Reports/MakeReadyReportWeb.rpt")
        'Try

        rd.Load(myfilelocation)
        rd.SetParameterValue(0, mWO_Number)
        rd.SetDatabaseLogon("sa", "sh4207", "10.10.10.44,8433", "AptGalleryInspections")

        Dim mSelection As String = ""
        Select Case mSubtype
            Case Is = "1"
                mSelection = "{MakeReadyMaster.WO_Number}={?WorkOrderNo} and ({MakeReadyDetails.PreInspect})=true "
            Case Is = "2"
                mSelection = "{MakeReadyMaster.WO_Number}={?WorkOrderNo} and ({MakeReadyDetails.Condition}<>'Satisfactory' and {MakeReadyDetails.Condition}<>'N/A' and {MakeReadyDetails.Condition}<>'Incomplete')"
        End Select

        rd.RecordSelectionFormula = mSelection
        Dim logon As New TableLogOnInfo
        Dim tbl As Table
        For Each tbl In rd.Database.Tables
            logon = tbl.LogOnInfo
            logon.ConnectionInfo.ServerName = "xx.xx.xx.x,xxxx"
            logon.ConnectionInfo.DatabaseName = "AptGalleryInspections"
            logon.ConnectionInfo.UserID = "sa"
            logon.ConnectionInfo.Password = "sh4207"
            logon.ConnectionInfo.Type = ConnectionInfoType.SQL
            tbl.ApplyLogOnInfo(logon)
        Next

        For Each connection As IConnectionInfo In rd.DataSourceConnections
            connection.SetConnection("10.10.10.44,8433", "AptGalleryInspections", "sa", "sh4207")
        Next

        CR1.ReportSource = rd


Crystal-Login-Page.gif
0
CrashmanCommented:
You are using Stored Procedures for the report?

try this

Dim rd As New ReportDocument
        Dim rptDS As New DataSet
        Dim rptDS2 As New DataSet
        Dim myCmd As New SqlCommand
        Dim da As New SqlDataAdapter
       

        Dim myfilelocation As String = Server.MapPath("../Reports/MakeReadyReportWeb.rpt")
        'Try

        rd.Load(myfilelocation)
        rd.SetParameterValue(0, mWO_Number)

        Dim mSelection As String = ""
        Select Case mSubtype
            Case Is = "1"
                mSelection = "{MakeReadyMaster.WO_Number}={?WorkOrderNo} and ({MakeReadyDetails.PreInspect})=true "
            Case Is = "2"
                mSelection = "{MakeReadyMaster.WO_Number}={?WorkOrderNo} and ({MakeReadyDetails.Condition}<>'Satisfactory' and {MakeReadyDetails.Condition}<>'N/A' and {MakeReadyDetails.Condition}<>'Incomplete')"
        End Select

        rd.RecordSelectionFormula = mSelection
        For Each connection As IConnectionInfo In rd.DataSourceConnections
            connection.SetConnection("10.10.10.44,8433", "AptGalleryInspections", "sa", "sh4207")
        Next
        CR1.ReportSource = rd
       
0
mgmhicksAuthor Commented:
I finally solved the problem.  The code was fine.  I had created the reports using sql native client as soon as I made it oledb the problems went away.  Dont know exactly why sql natvie doesnt work on web machine, but I have things running.  
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgmhicksAuthor Commented:
Turned out to be the driver the reports were created with.  However I think this solution will be helpful to others as well.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.