2013-06-01 146 views
0

我的代码是:名单<词典<字符串,字符串>>边界到Telerik报告

IList<Dictionary<string,string>> list = new List<Dictionary<string,string>>(); 
     Dictionary<string, string> a = new Dictionary<string, string>(); 
     a["a1"] = "zhuwei"; 
     a["a2"] = "zhanglong"; 
     a["a3"] = "zhaoguang"; 

     Dictionary<string, string> b = new Dictionary<string, string>(); 
     b["a1"] = "zhuwei1"; 
     b["a2"] = "zhanglong1"; 
     b["a3"] = "zhaoguang1"; 

     list.Add(a); 
     list.Add(b); 

     this.DataSource = a; 

环境的Silverlight 我想说明的是:


a1  a2   a3 

zhuwei   zhanglong  zhaoguang 

zhuwei1  zhanglong  zhaoguang 

如此,如何解决它?

回答

0

您可以使用Telerik Reporting提供的ObjectDataSource Component来绑定报告。你将不得不您的列表分配到ObjectDataSource实例的DataSource属性,然后设置报表的DataSource到使用ObjectDataSource控件的InstanceReportSource如:

//创建一个新的报告 Telerik.Reporting.Report报告= Telerik的新.Reporting.Report();

// Assigning the ObjectDataSource component to the DataSource property of the report. 
report.DataSource = objectDataSource; 

// Use the InstanceReportSource to pass the report to the viewer for displaying 
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource(); 
reportSource.ReportDocument = report; 

// Assigning the report to the report viewer. 
reportViewer1.ReportSource = reportSource; 
相关问题