Hi,
I'm trying to dynamically get my data source from my database using a query but it shows the wrong report source even though the query and data source is correct.
Public DA AsNew SqlDataAdapter
Public DS As DataSet
PublicFunction executeViaSQL(ByVal sqlquery AsString)As DataSet
DS =New DataSet
DA =New SqlDataAdapter(sqlquery, Conn)
DA.Fill(DS,0)
Return DS
EndFunction
PrivateSub formload
Dim RS AsNew rptDaily
DS =New DataSet
DS = executeViaSQL(query)'query is public and has a stored query
RS.Load()
RS.SetDataSource(DS.Tables(0))
CrystalReportViewer1.ReportSource = RS
EndSub
The report is showing the default report source even though I've set the report source to a dataset from my database.