我的数据库结构就像
ID, DESCRIPTION, VALUE
当我尝试生成RDLC报告时
我的代码:
private void button1_Click(object sender, EventArgs e)
{
historicalData_gb.Visible = false;
DataSet1TableAdapters.Load_ProfileTableAdapter tb4 = new DataSet1TableAdapters.Load_ProfileTableAdapter();
DataSet1.Load_ProfileDataTable ds = tb4.GetData();
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource4 = new Microsoft.Reporting.WinForms.ReportDataSource("Load_Profile", ds.AsEnumerable().CopyToDataTable());
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DisplayName = "Load Profile";
reportViewer1.LocalReport.ReportPath = @"C:\Users\SalmanMushtaq\documents\visual studio 2013\Projects\Sec_Report_Rdlc\Sec_Report_Rdlc\load_profile.rdlc";
reportViewer1.LocalReport.DataSources.Add(reportDataSource4);
reportViewer1.RefreshReport();
}
现在报告显示为
ID, DESCRIPTION, VALUE
但我需要显示DESCRIPTION
这样的报告有3种条目,即P1,P2,P3
,所以我需要显示ID, P1, P2, P3, VALUE
为此,我添加模型“Linq to Sql”,现在我需要显示报告,如上所述。请帮忙。