I tried to create a crystal report according to the user choice in a vb form. For that i like to pass a dynamically generated query
to crystal report. But when im assigning the "SetDataSource" property of CR by the following coding its giving the error
"Object reference not set to an instance of an object ." ....
i used the following coding...
Thanks in advance
Public Class Form1
Dim rpt As CrystalReport1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cnn As OleDbConnection
cnn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\ELA\Current\Tailor_Software\TailorDb.mdb")
Dim da As New OleDbDataAdapter("select * from User_Master", cnn)
Dim ds As New DataSet
rpt.SetDataSource(ds.Tables(1)) 'I am having the error at here
CrystalReportViewer1.ReportSource = rpt