alien Posted July 11, 2007 Posted July 11, 2007 (edited) 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 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 Edited July 12, 2007 by PlausiblyDamp Quote
amir100 Posted July 15, 2007 Posted July 15, 2007 Does the "fill" work? Have you set your crystal report "database fields" correctly? Is it to late for me to reply? :D Quote Amir Syafrudin
alien Posted July 16, 2007 Author Posted July 16, 2007 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. Quote
pendragon Posted July 16, 2007 Posted July 16, 2007 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 haven't looked into it since, to lazy I guess :o Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.