I have a windows form with a CrystalReportViewer, button, and OpenFileDialog.
I would like the user to be able to select the report to view but I want the application to supply the username/password. I really don't want the Database Login dialog box to appear. Is this possible?
Private Sub btnOpenReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenReport.Click
OpenFileDialog1.Filter = "Crystal Reports|*.RPT"
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
CrystalReportViewer1.ReportSource = OpenFileDialog1.FileName
Private Sub CrystalReportViewer1_ReportRefresh(ByVal source As Object, ByVal e As CrystalDecisions.Windows.Forms.ViewerEventArgs) Handles CrystalReportViewer1.ReportRefresh
Dim logOnInfo As New TableLogOnInfo
logOnInfo.ConnectionInfo.ServerName = "servername"
logOnInfo.ConnectionInfo.DatabaseName = ""
logOnInfo.ConnectionInfo.UserID = "username"
logOnInfo.ConnectionInfo.Password = "password"