Skip to Content
Former Member
Jan 24, 2013 at 06:21 PM

What could be causing a missing DB field on my Crystal Report at run-time?


Ladies & Gentlemen,

I have been, thus far, successful in programmatically pulling records from a MySQL database to create a crystal report from a single table. Using the code below, I'm trying to pull records from two tables - customer & cc_master. Now, all the fields are coming from the cc_master table except for one - nameCOMPANY - which is coming from the customer table.

At during debug, the report is displaying all the records from the cc_master table and the one field from the customer table isn't being displayed. Any help would be greatly appreciated - my knowledge is quite limited, so please go easy on me. All that I've done thus far is by watching Youtube videos and reading online articles. Below is my code and two screenshots (one showing the report and the other showing the DataSet Visualizer with the records from the query).

Here's my VS Code containing the query:

NotifyIcon1.ShowBalloonTip(3000, "Running Report, Please Wait.....", "The report you requested is being generated." & vbCrLf & _
"Please be patient, based on the data being requested it could take more than a few seconds.", ToolTipIcon.Info) Dim myConnectionString As String = "Server=" & FormLogin.ComboBoxServerIP.SelectedItem & ";Port=3306;Uid=parts;Password=parts;Database=accounting;"
Dim dbQuery As String = "SELECT customer_accountNumber, nameCOMPANY, ccID, cardholderFirstname, cardholderLastname, cardholderSalutation, ccNumber, " & _
"ccExpireMonth, ccExpireYear, ccZipcode, ccLocation, ccType, ccAuthorizedUseStart, ccAuthorizedUseEnd " & _
"FROM customer a, cc_master b " & _
"WHERE a.accountNumber = b.customer_accountNumber"
Dim dbAdapter As New MySqlDataAdapter(dbQuery, dbConn) NotifyIcon1.ShowBalloonTip(3000, "Querying the MySQL Database....", "The records necessary to compile your report " & vbCrLf & _
"are being retrieved from the datasource.", ToolTipIcon.Info)
Dim dbTable As New DataTable
Dim report As New rptCardListAll
CrystalReportViewer1.ReportSource = report
NotifyIcon1.ShowBalloonTip(3000, "Report Ready!", "The report you requested is now ready to view." & vbCrLf & _
"Thanks for your patience.", ToolTipIcon.Info)Catch ex As Exception
NotifyIcon1.ShowBalloonTip(3000, "AN ERROR HAS OCCURED...", ex.Message & vbCrLf & _
"Please report the problem to the IT/Systems Helpdesk @ Ext 131.", ToolTipIcon.Error)End Try