or
private void crosstab1_NeedDataSource(object sender, EventArgs e){ using (EntitiesModel dbContext = new EntitiesModel()) { int dealid = Global.GetInt32(this.ReportParameters["dealID"].Value.ToString()); int version = Global.GetInt32(this.ReportParameters["version"].Value.ToString()); bool amended = Global.GetBool(this.ReportParameters["amended"].Value.ToString()); bool postContract = Global.GetBool(this.ReportParameters["postContract"].Value.ToString()); bool staging = Global.GetBool(this.ReportParameters["staging"].Value.ToString()); bool commOption = Global.GetBool(this.ReportParameters["commOption"].Value.ToString()); IEnumerable<rsDealsDealerOpt> d = dbContext.GetDealsDealerOptions(dealid, version, postContract, staging, amended, commOption); crosstab1.DataSource = d; } public partial class Report1 : Telerik.Reporting.Report { public Report1() { //InitializeComponent(); //Not used, as not using Designer...right?? //Set up the datasource: Telerik.Reporting.SqlDataSource sqlDataSource = new Telerik.Reporting.SqlDataSource(); sqlDataSource.ProviderName = "System.Data.SqlClient"; sqlDataSource.ConnectionString = "Data Source=..."; sqlDataSource.SelectCommand = "SELECT..."; //Instantiate report: var report = new Telerik.Reporting.Report(); report.Name = "theReport"; //What other properties must I set?? //Set the data item's DataSource property to the SQL datasource: report.DataSource = sqlDataSource; //Some parameters: sqlDataSource.Parameters.Add("@Fields.Name", System.Data.DbType.String, "Blade"); //Export to PDF: exportToPDF(report); }I've downloaded the latest (v6.2) trial version of Telerik Reporting but cannot figure out how to hook it up to my Entity Framework model.
I've added an EntityDataSource to the designer but this requires a typeof(ObjectContext)which I don't have.
Looking at the example code from the Telerik website it appears I might be able to cast from DbContext to ObjectContext at runtime but this does not (that I can see) enable me to build a report at design time.
Is it possible to get Telerik Reporting to work with Entity Framework 5?