Solved

Crystal reports Logon box pops up prompting me for password

Posted on 2008-10-24
3
231 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

19 Experts available now in Live!

Get 1:1 Help Now