Solved

Crystal reports Logon box pops up prompting me for password

Posted on 2008-10-24
3
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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