Solved

Crystal reports Logon box pops up prompting me for password

Posted on 2008-10-24
3
230 Views
Last Modified: 2012-05-05
Here's what I have now, and am  getting prompted for the password in the logon box, before the report loads. The userid, database, and servername are filled in, but not the password.

Dim rpt as New CrystalDecisions.CrystalReports.Engine.ReportDocument

strConnstring = "Server=servername, Database = dbname, UID=sa, Pwd=Password1"

cn.connectionstring = strConnString
cn.open()

Dim crystalReportViewer1 as new CrystalDecisions.Web.CrystalReportViewer

dim rptPath as string
rptPath = Server.MapPath("Reports\CrystalInvoiceAnnual.rpt")
rpt.load(rptPath)

crystalReportViewer1,ReportSource = rpt
rpt.SetDatabaseLogon("sa", "Password1", "server", "db", True)

Rpt.Load(rptPath)

CrystalReportViewer1.reportsource = rpt
rpt.SetDatabaseLogon("sa","Password1","server", "db",True)

rpt.Refresh
0
Comment
Question by:jbh_blue
  • 2
3 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 22797108
If the report uses multiple tables you have to set the logon info for each table.

Something like this


  Private Sub configureCrystalReports()
        Dim myconnectioninfo As ConnectionInfo = New ConnectionInfo()
       
        With myconnectioninfo
               .DatabaseName = "SomeDatabase"
               .ServerName = "servername"
                .UserID =  "SomeUser"
                .Password = "password"
         end with
        SetDBLogOnForReport(myconnectioninfo)

    End Sub

    Private Sub SetDBLogOnForReport(ByVal myConnectionInfo As ConnectionInfo)
        Dim myTableLogonInfos As TableLogOnInfos = CrystalReportViewer1.LogOnInfo
        For Each myTabeLogoninfo As TableLogOnInfo In myTableLogonInfos
            myTabeLogoninfo.ConnectionInfo = myconnectioninfo
        Next
    End Sub


mlmcc
0
 

Author Comment

by:jbh_blue
ID: 22797171
The report is driven from one view.  I've tried the code that you listed, but got the same results. While inquiring about this problem yesterday, someone suggested the ReportDocument class.

0
 

Author Closing Comment

by:jbh_blue
ID: 31509679
Dude, this didn't really help me solve the problem, but it did help me understand the process (if that makes any sense),  that's why I'm closing and awarding you points.

Thanks for your help,

JB
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now