How can we generate Crystal Report through code in vb.net?

mukesh

Member
Joined
Jun 22, 2005
Messages
11
Programming Experience
1-3
Hi guys

Can anybody help me to generate the Crystal Report with .DBF files. I have fetched the data from .DBF files through ODBC (DSN). This is the code to show a report through code. If my Conn = SQL Server connection then this run very well, but if I change my conn = DSN like below then I found some problem. If anybody has some views pls help me.


Dim
mvarSysProjPath As String = "E:\DOS App\DE05"
Dim Conn As New OdbcConnection("DSN=PriceList")
Conn.Open()
Dim frm_Viewer As New frmReportViewer()
Dim ReportByDate As New crp()
Dim SqlQuery As String = "select * from FASPMST1.dbf"
Dim da As New System.Data.OleDb.OleDbDataAdapter(SqlQuery, Conn)
Dim ds As New System.Data.DataSet()
da.Fill(ds)
ReportByDate.SetDataSource(ds.Tables(0))
frm_Viewer.CrystalReportViewer1.ReportSource = ReportByDate
frm_Viewer.ShowDialog()


Thanks in advance.

Bye
 
Back
Top