0
は、私が質問レポートビューアでグラフの日付を表示する方法は?
How to show dates in a chart in Excel?
を尋ねた私は、Excelでこれを解決し、しかし、私はレポートビューアで同じ問題を抱えています。データを(前年に関連して)チャートの右側にシフトします。 私の日付データは文字列形式です。
List<Report> tempList = new List<Report>();
foreach (DataRow row in DT.Rows)
{
Report temp = new Report();//class
temp.Row = Convert.ToInt16(row["Row"].ToString());
temp.Date = row["Date"].ToString();
temp.Value= Convert.ToDouble(row["Value"].ToString());
tempList.Add(temp);
}
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();
string reportEmbeddedResource = "ETc.Report1.rdlc";
reportDataSource1.Name = "DataSet1";
reportDataSource1.Value = this.ReportBindingSource;
this.reportViewer.LocalReport.DataSources.Add(reportDataSource1);
this.reportViewer.LocalReport.ReportEmbeddedResource = reportEmbeddedResource;
this.ReportBindingSource.DataSource = tempList;
this.reportViewer.RefreshReport();