setting up Crystal
-
Hi Has any one out there used crystal with sql server to generate reports? I have been trying to get my code running that passes my login info and password to sql automatically. I have followed the instructions in the MSDN to set up these reports and one of the variables which I know I have declared is simply not being picked up. The code I ahve been making use of is as follows Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports CrystalDecisions.ReportSource Public Class Form1 Private Sub configurecrystalreports() Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() myConnectionInfo.DatabaseName = "Northwind" myConnectionInfo.UserID = "limitedPermissionAccount" myConnectionInfo.Password = "1234" Dim reportpath As String = Application.StartupPath & "\" & "northwind.rpt" myCrystalReportViewer.ReportSource = reportpath setdblogforreport(myConnectionInfo) End Sub Private Sub setdblogforreport(ByVal myconnectioninfo As ConnectionInfo) Dim mytablelogoninfo As TableLogOnInfos = myCrystalReportViewer.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In [myTableLogOnInfos] ' vbstates that I 'have not declared mytablelogonInfo. myTableLogOnInfo.ConnectionInfo = myconnectioninfo Next End Sub I have gone over the instructions in the MSDN several times and I am still getting the same error. What am I doing wrong, or is there an easier way of doing this that is not using the wizards?
-
Hi Has any one out there used crystal with sql server to generate reports? I have been trying to get my code running that passes my login info and password to sql automatically. I have followed the instructions in the MSDN to set up these reports and one of the variables which I know I have declared is simply not being picked up. The code I ahve been making use of is as follows Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports CrystalDecisions.ReportSource Public Class Form1 Private Sub configurecrystalreports() Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() myConnectionInfo.DatabaseName = "Northwind" myConnectionInfo.UserID = "limitedPermissionAccount" myConnectionInfo.Password = "1234" Dim reportpath As String = Application.StartupPath & "\" & "northwind.rpt" myCrystalReportViewer.ReportSource = reportpath setdblogforreport(myConnectionInfo) End Sub Private Sub setdblogforreport(ByVal myconnectioninfo As ConnectionInfo) Dim mytablelogoninfo As TableLogOnInfos = myCrystalReportViewer.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In [myTableLogOnInfos] ' vbstates that I 'have not declared mytablelogonInfo. myTableLogOnInfo.ConnectionInfo = myconnectioninfo Next End Sub I have gone over the instructions in the MSDN several times and I am still getting the same error. What am I doing wrong, or is there an easier way of doing this that is not using the wizards?
twsted f8 wrote:
Dim mytablelogoninfo As TableLogOnInfos = myCrystalReportViewer.LogOnInfo
twsted f8 wrote:
For Each myTableLogOnInfo As TableLogOnInfo In [myTableLogOnInfos]
Is that the difference, maybe?