我是RDLC報告新手,我的要求很簡單。 我設計了一個報告,並在該報告中設置了一些參數來填充動態數據。RDLC動態表綁定
現在我有要求動態顯示錶。 所以我做了什麼:
DataSet InvoiceSummaryDs = new DataSet();
DataTable table = new DataTable();
table.TableName = "summary";
table.Columns.Add("name", typeof(string));
table.Rows.Add(Invoice.TotalBooking);
table.Rows.Add("£ " + Invoice.BillAmount);
table.Rows.Add("£ " + Invoice.BillAmount + " <br />" + "£ " + Invoice.VatAmount);
table.Rows.Add("£ " + Invoice.NetAmount);
InvoiceSummaryDs.Tables.Add(table);
ReportDataSource rptDataSource = new ReportDataSource("DSPrice", InvoiceSummaryDs.Tables[0]);
rv.LocalReport.DataSources.Add(rptDataSource);
rv.LocalReport.SetParameters(parms);
rv.LocalReport.Refresh();
所以在服務器端代碼沒有問題,但我在報告中得到錯誤: 錯誤13集「DS_NAME」指的是數據源「」不存在。
錯誤14 tablix'Tablix1'在報告正文中,但報告沒有數據集。沒有數據集的報告中不允許使用數據區域。
在rdlc文件中,我創建了一個名稱爲「DSPrice」的數據集,沒有源,因爲我想從服務器端動態地填充數據而不是從這裏。
我已經看到這個例子:
http://www.gotreportviewer.com/ 生成RDLC動態 - 表
在動態表結合是可能thorugh動態報表生成,但我不希望創建動態報告。
任何人指導我有什麼解決方案? 任何幫助,將不勝感激。