運行

2010-07-30 32 views
17

期間如何生成使用C#的RDLC文件,我在做一些應用開發(CRM解決方案),需要 產生示意在運行時RDLC文件。我怎麼做?運行

回答

15

您可以使用「動態生成RDLC - 表」從got reportviewer?頁例如

+0

+1謝謝.......... – 2010-07-30 09:59:27

+2

+1爲http://www.gotreportviewer.com/DynamicTable.zip – Krunal 2010-07-30 10:56:01

1

我可以確認您正在嘗試構建基於RDLC的動態報告解決方案,還是隻需要挖掘存儲在CRM中的數據並將其顯示在RDLC中?我想你已經用盡了Proclarity和Excel等其他工具,以便用戶挖掘數據。假設前者(即一個RDLC設計者),那麼RDLC只是一個XML文件,所以我想你可以通過在首次導出某種類型的數據之後應用XSLT來創建包含數據源,字段定義,單元格等的簡單的標準RDLC。你的設計師的xml'模型'?

聽起來像很多工作;)

+0

我要生成RDLC文件 – 2010-07-30 08:55:36

+0

+1謝謝.......... – 2010-07-30 09:59:55

2

感謝所有誰回答了這個問題的答案,但我發現一個好文章生成動態報告:Dynamic Reports with Reporting Services

+0

不錯的鏈接pranay ...! ! – Krunal 2010-07-30 10:10:17

+0

謝謝.................. – 2010-07-30 10:29:08

1

您只需通過編碼更改數據源即可。 像

 ReportViewer.LocalReport.DataSources.Clear(); 
     ReportViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local; 


     ReportDataSource RDS = new ReportDataSource(); 
     RDS.Name = "DataSet"; 


     RDS.Value = itemReportTableBindingSource; 
     ReportViewer.LocalReport.ReportEmbeddedResource = "RFID.Reports.ItemsReport.rdlc"; 
     ReportViewer.LocalReport.DataSources.Add(RDS); 

     this.itemReportTableTableAdapter.Fill(this.reportsDataSet.ItemReportTable); 
     this.ReportViewer.RefreshReport(); 
0

您應該諮詢此鏈接可能會有所幫助

How to dynamically add new columns to report created with Reporting Services?

RDLC報告是一個XML文件,並通過爲XMLDocument編輯它,你可以修改定位/報告/美體/ ReportItems /表節點並在其中執行以下操作

  • 定義新列的標頭 - 在標頭節點內添加一個新的TableCell
  • 綁定數據(從數據表)中的列 - 添加新的TableCell詳細節點
  • 內定義式柱的寬度 - 添加新的TableColumn內部TableColumn來