|
-
Mar 22nd, 2013, 08:01 PM
#1
Thread Starter
New Member
Creating a Crystal Report based on a dataset
Hello,
I'm writing a VB application and I want to create a report using Crystal Reports 9. I want to base it on a dataset that I populate programatically. When I view the report, no records show up, and there are records in the underlying table. Here is the code:
Dim con As New OleDbConnection
Dim cmd As New OleDbCommand
Dim da As New OleDbDataAdapter
Dim cb As OleDbCommandBuilder
Dim ds As New NamesNumbersDataSet 'NamesNumbersDataSet was generated when I added the dB
Dim rpt As New CrystalReport1
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Ralph\Documents\Visual Studio 2010\Projects\Crystal Reports using OLEdB\Crystal Reports using OLEdB\Crystal Reports using OLEdB\NamesNumbers.mdb"
con.Open()
cmd.Connection = con
cmd.CommandText = "select First, Last from tblNames"
da.SelectCommand = cmd
cb = New OleDbCommandBuilder(da)
da.Fill(ds)
rpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.RefreshReport()
CrystalReportViewer1.Show()
con.Close()
Why are there no records showing up on the report? It is based on NamesNumbersDataSet.xsd
Thanks,
Ralph1965
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|