2013-06-01 3 views
0

моего кода:List <Dictionary <строка, строка >> ограничивающие к 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

Вы можете связать отчет, используя ObjectDataSource Component, который предоставляет отчет Telerik. Вы должны назначить свой список в DataSource свойства экземпляра ObjectDataSource, а затем установить DataSource в Докладе к InstanceReportSource, который использует ObjectDataSource например:

// Создание нового отчета отчета 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; 
Смежные вопросы