I have a report with a simple bar chart. I am using report parameters to filter the queries. When i edit the parameter values and hit preview, the chart needdatasource event fires but the chart is not getting updated in the report.
below is the code in the chart needdatasource event. I am populating the recordCount collection in the Report NeedDatasource event.
private void chart1_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.Chart procChart = (Telerik.Reporting.Processing.Chart)sender;
Telerik.Reporting.Chart defChart = (Telerik.Reporting.Chart)procChart.ItemDefinition;
procChart.DataSource = null;
procChart.DataSource = recordCount;
defChart.Series[1].DataYColumn = "Status";
defChart.PlotArea.XAxis.DataLabelsColumn = "chartlbl";
//defChart.PlotArea.XAxis.LayoutMode = Telerik.Reporting.Charting.Styles.ChartAxisLayoutMode.Inside;
defChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Ariel", 8);
}
Could you please let me know if I am doing anything wrong above.
Thanks
below is the code in the chart needdatasource event. I am populating the recordCount collection in the Report NeedDatasource event.
private void chart1_NeedDataSource(object sender, EventArgs e)
{
Telerik.Reporting.Processing.Chart procChart = (Telerik.Reporting.Processing.Chart)sender;
Telerik.Reporting.Chart defChart = (Telerik.Reporting.Chart)procChart.ItemDefinition;
procChart.DataSource = null;
procChart.DataSource = recordCount;
defChart.Series[1].DataYColumn = "Status";
defChart.PlotArea.XAxis.DataLabelsColumn = "chartlbl";
//defChart.PlotArea.XAxis.LayoutMode = Telerik.Reporting.Charting.Styles.ChartAxisLayoutMode.Inside;
defChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Ariel", 8);
}
Could you please let me know if I am doing anything wrong above.
Thanks