我有一個rdlc報告我想將我自己的自定義類的列表綁定爲數據源。RDLC報告沒有使用動態綁定的數據源進行分頁
我用建議的this site一些代碼來構建數據表
這個作品真的很好
//convert my list of Invoices to a DataTable
var dt = invoices.CopyToDataTable(dataTable, LoadOption.PreserveChanges);
//Setup a new DataSource
var rds = new ReportDataSource {Name = "ReportDataSet", Value = dt};
//Add that datasource to my ReportViewer
rvSampleInvoice.LocalReport.DataSources.Add(rds);
//Map my report path, etc
rvSampleInvoice.LocalReport.ReportPath = Server.MapPath("etc");
這一切工作正常,當我加載我的網頁,報告顯示,但只有它有一個2頁。第一個是我的發票集合中的第一個條目,當我點擊下一頁時,它是一個空白頁面。 我已經給頁面添加了一個gridview,並將DataTable(dt)綁定到它,並且它顯示爲一個很好的表格,其中包含一行標題和20行數據。
我想知道如果我有什麼不對有關如何將RDLC綁定到我的發票