I have an application that reads from a data base table and fills a DataSet and consequently binds to a DataGrigView. Now I need to add a Crystal Report Viewer to the same form and display the query result.
I have defined my data set in the code (no user controls from tool box). When I try to fill the Crystal Report it only show the heading and tells me "The Report has no tables". Do I need to define a schema for my CR? I tried to use the database expert but I do not have a data set to link to (since defined in code). Can anybody help?
Code:Dim mySqlCommand As New SqlCommand("sp_GetjobTable", ServerConnection) Dim mySqlAdapter = New SqlDataAdapter(mySqlCommand) Dim mySqlDataSet As New DataSet Dim JobTable As New DataTable mySqlAdapter.fill(mySqlDataSet, "JobTable") DataGridView1.DataSource = mySqlDataSet.Tables("JobTable") myCrystalReport.SetDataSource(mySqlDataSet.Tables("Jobtable")) MyCrystalReportViewer.ReportSource = myCrystalReportCode:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ConfigureCrystalReports() End SubCode:Private Sub ConfigureCrystalReports() End Sub




Reply With Quote