Is it possible to attach a datareader to a crystal report? I successfully attached a report to a dataset but can't figure this one out. Here is the code I tried (vb.net):
Dim SqlConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("SqlConn"))
Dim cmd1x1x61 As SqlCommand = SqlConn.CreateCommand
cmd1x1x61.CommandType = CommandType.StoredProcedure
cmd1x1x61.CommandText = "sp1x1x61"
Try
SqlConn.Open()
cmd1x1x61.ExecuteReader()
crv1x1x61.ReportSource = rpt1x1x61
rpt1x1x61.SetDataSource(cmd1x1x61)
crv1x1x61.DataBind()
Catch ex As Exception
Finally
cmd1x1x61.Connection.Close()
SqlConn.Close()
End Try
Dim SqlConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("SqlConn"))
Dim cmd1x1x61 As SqlCommand = SqlConn.CreateCommand
cmd1x1x61.CommandType = CommandType.StoredProcedure
cmd1x1x61.CommandText = "sp1x1x61"
Try
SqlConn.Open()
cmd1x1x61.ExecuteReader()
crv1x1x61.ReportSource = rpt1x1x61
rpt1x1x61.SetDataSource(cmd1x1x61)
crv1x1x61.DataBind()
Catch ex As Exception
Finally
cmd1x1x61.Connection.Close()
SqlConn.Close()
End Try