Posted 4 January 2023, 11:29 am EST
I try to set datasource at runtime in my report of Activereports 10.
i have this code :
Sub ActiveReport_ReportStart
Dim connectionString = “Data Source=PC\SQLEXPRESS;Initial Catalog=Contratti;Integrated Security=True”
Dim con As SqlConnection = New SqlConnection(connectionString) con.Open() Dim _strSQL As String = "Select id , cod from customers" Dim _cm As New SqlClient.SqlCommand(_strSQL, con) Dim _dt As New DataTable Dim _da As New SqlClient.SqlDataAdapter(_cm) _da.Fill(_dt) _dt.TableName = "customers" Me.DataSource = _dt
End Sub
I have the error :
localhost:52620
Error: Report Script Compile Error on line 50 :
‘DataSource’ non è un membro di ‘Script.ReportScript’
What can i control ?
i’d like load my datatable at runtime and set it to the report .
Thank you