Hi,
I have a master report with 3 subreports and there is a bar chart on one of the subreports. In the bar chart report class, I have a databind fiunction, for testing, I am manually populate the data, but later on I need to pass a dataset into this function.
public void DataBind(DataSet aDS)
{
ChartSeries chartSeries = new ChartSeries();
chartSeries.Name = "Sales";
chartSeries.Type = ChartSeriesType.Bar;
// add new items to the series,
// passing a value and a label string
chartSeries.AddItem(120, "Internet");
chartSeries.AddItem(140, "Retail");
chartSeries.AddItem(35, "Wholesale");
chart1.Series.Add(chartSeries);
//bind DAtaSet
chart1.ChartTitle.TextBlock.Text =
"My Test Chart";
chart1.Report.DataSource = aDs;
chart1.Series.Clear();
ChartSeries s = new ChartSeries();
s.Type =
ChartSeriesType.Pie;
s.DataYColumn =
"Value";
s.DataLabelsColumn =
"Desc";
chart1.Series.Add(s);
}
On the master report class I have a function that call the databind function,
public void SubReportChartDataBind(DataSet aDS)
{
MyChartReport rpt = new MyChartreport();
rpt.DataBind(aDS);
subReport3.ReportSource = rpt;
}
and this SubReportChartDataBind function called by the report viewer aspx page.
DataSet oDS = GetDataSetForChart();
MyReportMaster rptMaster = new MyReportMaster();
rptMaster.SubReportChartDataBind(oDs);
this.ReportViewer1.Report =rptMaster;
But on the chart, ther is no data shown, the error is "
there is no or empty series". Anybody can give me a hand?
Thanks in advance