crystal reports

alien

Member
Joined
Mar 21, 2006
Messages
24
Hi guys

I am new with crystal reports and i am trying to load a crystal report wirh data . What i want is to display just one record on the crystal report. I want a user to enter say a customer name then using an sql string the record is searched from the database and displayed on textboxes as well as on a crystal report. I cant seem to get it to display the record on the cryatal report. i have a crystal reportviewer on the from.(vb.net 2003 and Access database)


this is the code am using
Code:
Dim uname As String = txtcustomerid.Text

Dim connString As String = "Provider=Microsoft.Jet.oledb.4.0;Data source=D:\Documents and Settings\bob\My Documents\VB\Soldiers Of Christ\bin\S.O.C.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString

Dim da As OleDbDataAdapter = New OleDbDataAdapter("select * from SOCcustomerdetails where Customernumber = " & uname & "", myConnection)

Dim ds As DataSet = New DataSet
      
da.Fill(ds, "SOCcustomerdetails")
Dim x As New CrystalReport2
x.SetDataSource(ds)
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.ReportSource = x
Thanks
 
Last edited by a moderator:
Does the "fill" work?

Have you set your crystal report "database fields" correctly?

Is it to late for me to reply? :D
 
No its not too late to reply. Anyway I still havent found a way around it. And yes, i have set the database fields on the crystal reports right.
 
The only way I have ever got it to work is to set the datasource on each table in the report.

x.Database.Tables[0].SetDataSource(TableName);

There might be another way to do it, I have been using this since the first VS.NET as there was a know bug and havent looked into it since, to lazy I guess :o
 
Back
Top