Hi,
I am pretty new to Telerik Reporting and I am using C# WPF. I have set a datatable to the DataSource of Report. The datatable is generated correctly with all rows from specified DB. But it is not displayed in ReportViewer. Below is my code snippet. Please advise.
Telerik.Reporting.Report myReport = new Telerik.Reporting.Report();
string selectCommand = @"SELECT * FROM Angle";
string connectionString = @"Data Source=IndianSections.db3";
using (var connection = new SQLiteConnection(connectionString))
{
using(var command = new SQLiteCommand(connection))
{
connection.Open();
command.CommandText = selectCommand;
using (var reader = command.ExecuteReader())
{
SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter(selectCommand, connectionString);
DataTable dataTable = new DataTable();
dataTable.Load(reader);
//dataAdapter.Fill(dataTable);
var objectDataSource = new Telerik.Reporting.ObjectDataSource();
objectDataSource.DataSource = dataTable;
myReport.DataSource = objectDataSource;
var reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = myReport;
this.reportViewer.ReportSource = (reportSource as ReportSource);
this.reportViewer.RefreshReport();
}
// connection.Close();
}
}