Solved

Crystal Reports Login Info

Posted on 2012-04-09
4
499 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
[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
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 37826199
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
ID: 37827722
OLEDB,

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

Author Closing Comment

by:Wildone63
ID: 37827984
I just made an ODBC connection and it works fine.

Thank You.
0
 
LVL 100

Expert Comment

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

mlmcc
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
Get sourcecode path 14 46
Find date of 2nd Thursday of each month 3 32
VB.Net  Exporting Excel Woorkbook to PDF 7 58
VB.Net Data Class 1 18
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

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