Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing Logon Info issue
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Rapports
Titre:
Changing Logon Info issue
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00976064
Message ID:
00976064
Vues:
31
I was creating a simple report project to learn how to do it, by following code from Les Pinters Visual Foxpro to VB.net. I have the report showing, but one thing I need to do, in code, is change the logoninfo for the report. In the book, he says to do that before assigning the ReportSource. But I'm getting an error on the the first line after the Try statement.

Error: "Object reference not set to an instance of an object."

Anyone know what I'm failing to do?

Thanks
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

        Dim Tab As CrystalDecisions.CrystalReports.Engine.Table
        Dim LogonInfo As CrystalDecisions.Shared.TableLogOnInfo
        Try
            LogonInfo = Tab.LogOnInfo
            With LogonInfo.ConnectionInfo
                .ServerName = "(Local)"
                .UserID = "sa"
                .Password = "myPassword"
                .DatabaseName = "ctore"
            End With
            Tab.ApplyLogOnInfo(LogonInfo)
        Catch ex As Exception
            Dim cError As String = ex.Message.ToString
            MsgBox(cError)
        End Try

        Select Case ComboBox1.Text
            Case "<Pick a Report>"
                CrystalReportViewer1.ReportSource = Nothing
            Case "SimpleReport1"

                CrystalReportViewer1.ReportSource = New SimpleReport1

        End Select
    End Sub
Répondre
Fil
Voir

Click here to load this message in the networking platform