Solved

Crystal Reports Login Info

Posted on 2012-04-09
4
493 Views
Last Modified: 2012-06-27
I have several crystal reports that I have put into ASPX pages using the crystal report viewer and crystal report source.

I have two differnet databases, One that I can only get to via ODBC. One that is a local MS-SQL server 2008.

When I launch the reports that use the ODBC/DSN everything works fine. but I can not get to the local Database.

Here is the code behind that I am using to provide the login credentials.

This does not work for local db. The error i get is db login failed. But it works fine in my designer.

    Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
        Dim ConnInfo As New ConnectionInfo

        With ConnInfo
            .ServerName = "web01"
            .DatabaseName = "iwonline"
            .UserID = "sa"
            .Password = "password"

        End With

        For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo
            cnInfo.ConnectionInfo = ConnInfo
        Next
    End Sub


This DOES work for the DSN connections...

    Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
        Dim ConnInfo As New ConnectionInfo

        With ConnInfo
            .ServerName = "Netsuite.com"
            .DatabaseName = ""
            .UserID = "me@mynet.net"
            .Password = "password"

        End With

        For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo
            cnInfo.ConnectionInfo = ConnInfo
        Next
    End Sub
0
Comment
Question by:Wildone63
  • 2
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
What connection method are you using for the local database?
Do you have an ODBC connectionto it?

mlmcc
0
 
LVL 1

Author Comment

by:Wildone63
Comment Utility
OLEDB,

No I do not have an odbc connection to the local db.
0
 
LVL 1

Author Closing Comment

by:Wildone63
Comment Utility
I just made an ODBC connection and it works fine.

Thank You.
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
As far as I knkow you cannot change the connection type for a report at run time.

mlmcc
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

7 Experts available now in Live!

Get 1:1 Help Now