I have a big problem presenting the information I want on the report. I am trying to put data from two tables so far with no success. I did a good search on the forum and google without finding an answer to correct it. I have tables 1 and 2. I use 3 fields from table1 and one from table2. The fields from table1 show up but not the ones from table2. Here is the code I use to load the report and fill it up on the winform load event.
I have tried some other ways to call and fill the report but with no success. As I see from the forum this is big issue as most post with this problem are not resolved or with no replies from anyone with a solution to it. Thanks for the replies and all the help so farCode:Dim rpt As New CrystalReport1() 'The report you created. Dim conn As OleDbConnection Dim MyCommand As New OleDbCommand Dim myDA As New OleDbDataAdapter Dim myDS As New Database2DataSet 'The DataSet we created Try conn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\Serverjde\jde\Database0.accdb;Persist Security Info=False;") MyCommand.Connection = conn MyCommand.CommandText = "SELECT * FROM AllServices ORDER BY StartDate ASC" MyCommand.CommandType = CommandType.Text myDA.SelectCommand = MyCommand myDA.Fill(myDS, "AllServices") rpt.SetDataSource(myDS) CrystalReportViewer1.ReportSource = rpt Catch Excep As Exception MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try




Reply With Quote