Hello. I set up a few Telerik reports a couple of years ago, and now I'm trying to remind myself how they work. :-)
I am creating a new report that has a dynamic datasource here:
The report works fine when I build the project and view it through the report viewer, however, I cannot get the data to run in the Preview version of the report, and the designer does not recognize that any fields are available for the report.
I tried using a SqlDataSource stored procedure, but I have been unable to successfully pass in the date parameters when trying to run the stored procedure.
So, my question is: how to I get the report to recognize that data fields are available for creating the report when I have a dynamic data source? Thanks!!
I am creating a new report that has a dynamic datasource here:
public Report1()
{
/// <
summary
>
/// Required for telerik Reporting designer support
/// </
summary
>
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
this.NeedDataSource += new System.EventHandler(this.Report1_NeedDataSource);
}
private void Report1_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
int advertiserID = int.Parse(report.Parameters["advertiserID"].Value.ToString());
DateTime dtStartDate = DateTime.Parse(report.Parameters["startDate"].Value.ToString());
DateTime dtEndDate = DateTime.Parse(report.Parameters["endDate"].Value.ToString());
report.DataSource = (GetBannersByMonthByAdvertiser(advertiserID, dtStartDate, dtEndDate)).Tables[0];
}
The report works fine when I build the project and view it through the report viewer, however, I cannot get the data to run in the Preview version of the report, and the designer does not recognize that any fields are available for the report.
I tried using a SqlDataSource stored procedure, but I have been unable to successfully pass in the date parameters when trying to run the stored procedure.
So, my question is: how to I get the report to recognize that data fields are available for creating the report when I have a dynamic data source? Thanks!!