Thanks all for the suggestions. This is my first time using Crystal Report, and I do
appreciate all your help very much.
I put the database fields in the details section from the field
explorer, still the field items are not displayed in
the Crystal Report when I run the report. I checked the database table if it has the field items
that I want to display, and it does. Since the field items that I place in crystal report is from
this table, I thought it should be displayed when I run the report.
Below is a sample code from the load event of crystal report viewer.
Is there something in the code or am I doing it right?
What can I do to display the field items in the report? Thanks much in advance.
Private Sub CrystalViewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalViewer.Load, MyBase.Load
Dim rpt As New CrystalReport1()
Dim myconnection As OleDbConnection
Dim mycommand As New OleDbCommand()
Dim myDA As New OleDbDataAdapter()
Dim myDS As New DataSet()
Dim strSQL As String
Dim conn As OleDbConnection
strSQL = "SELECT StreetAddress, City, State, Zipcode, Country "
strSQL += "FROM Employee_Address"
Try
conn = New OleDbConnection(mvarConnectionString)
myDA = New OleDbDataAdapter(strSQL, mvarConnectionString)
conn.Open()
myDA.Fill(myDS, "Crystal Report"

rpt.SetDataSource(myDS)
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
For Each tbCurrent In rpt.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = " "
.UserID = " "
.Password = " "
.DatabaseName = " "
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
CrystalReportViewer.ReportSource = rpt
CrystalReportViewer.Visible = True
CrystalReportViewer.Zoom(100)
CrystalReportViewer.RefreshReport()
Catch ex As OleDbException
MsgBox(ex.Message, MsgBoxStyle.Critical, "SQL Error"

Exit Sub
Catch exc As Exception
' Unable to connect to SQL Server
MessageBox.Show("Bind Data Grid Failed."

Exit Sub
Finally
rpt.Dispose()
conn.Close()
conn.Dispose()
myDS.Dispose()
myDA.Dispose()
End Try
End Sub