Solved

Crystal reports Logon box pops up prompting me for password

Posted on 2008-10-24
3
234 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

740 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