Solved

Crystal Reports Login Info

Posted on 2012-04-09
4
501 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 101

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 101

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

705 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