I selected the field items from the fields explorer table in crystal report. When I run the report, the field items are not displayed. How do I display the fields from the table in the fields explorer?
Crystal will create default Text Objects with the name of the fields in the page header if you place the fields in the Details Section.
If you're not getting any data, then you should select the lightning bolt to refresh data, if you still don't get anything, than there probably isn't any data, but more information is required to determine your problem.
You can also right click any field and select browse data to see if the field has naything in it.
Thanks for the suggestions. This is my first time using Crystal Report w/ VB.Net, 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. I did browse data, and it does have a field value that I want to display. 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 wrong?
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()
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
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.