To create a Telerik report in code, you need to instantiate a Telerik.Reporting.Report object and set its properties. For example, this code will create a report and set up its data source:
CopyC#
MyReport report = new MyReport();
string sql = @"SELECT * FROM Sales.Store";
string connectionString = "Data Source=(local)\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True";
SqlDataAdapter adapter = new SqlDataAdapter(sql, connectionString);
report.DataSource = adapter;
CopyVB.NET
Dim report As New MyReport()
Dim sql As String = "SELECT * FROM Sales.Store"
Dim connectionString As String = "Data Source=(local)\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True"
Dim adapter As New SqlDataAdapter(sql, connectionString)
report.DataSource = adapter
See Also