Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 3636

Wrong reportsource shown in crystalreportviewer

$
0
0

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.


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>