Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Logon Info issue
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Reporting
Title:
Changing Logon Info issue
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00976064
Message ID:
00976064
Views:
30
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
Reply
Map
View

Click here to load this message in the networking platform