Last post Jun 25, 2011 09:37 AM by bswanson
Jun 18, 2011 10:04 AM|bswanson|LINK
When I try to run this example, the CR ask for user name and password for the ServerName "ENXP-50701E". This field is disabled so it can not be change. I have replace the ServerName with MyServerName in every place I can find in the project. Using the Crystal
Report Database Menu item, Database Expert, the "ENXP-50701E" was removed.
The code has been put to connect to my server.
Private Sub ConfigureCrystalReports()
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
myConnectionInfo.DatabaseName = "Northwind"
myConnectionInfo.UserID = "creports"
myConnectionInfo.Password = "creports"
myConnectionInfo.ServerName = "BILLPC-64\SQLEXPRESS"
Dim reportPath As String = "C:\CR\crsdk_net_tutorials_115_en\crsdk_net_tutorials_115_en\DotNet2\VB_Win_Data_DataSets\VB_Win_Data_DataSets\NorthwindCustomers.rpt"
myCrystalReportViewer.ReportSource = reportPath
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
Dim myTableLogOnInfos As TableLogOnInfos = myCrystalReportViewer.LogOnInfo
For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
When I run the project, the report still asks for the log in information for the "ENXP-50701E" server that can not be changed. What am I missing?
Jun 25, 2011 09:37 AM|bswanson|LINK
I have not been able to get the example to work. But I have been able to get Crystal Reports to work on a different machine. The solution is to connect Cyrstal Reports to the ADO.NET DataSets. (Database Expert \ Project Data \ ADO.NET). When creating a
report with this connection, there will be a bunch of funcky data in the report in the deisigner. Here is the process I used to create the Cystal Reports:
1. Create the dataset using the sql statement from a table or view or better still use a stored procedure.
2. Creaate the Cyrstal Report connected to the dataset.
3. Create the form and add the Crystal ReportViewer to the page.
4. Code the load event to load the crystal reports and to push the data into it.
5. Run the project to see if the correct data shows on the form. If so then formatting the report can proceed.