0

我的代码是:

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

那么,如何解决呢?

4

1 回答 1

0

您可以使用Telerik Reporting 提供的ObjectDataSource 组件绑定报表。您必须将列表分配给 ObjectDataSource 实例的 DataSource 属性,然后将报表的 DataSource 设置为使用 ObjectDataSource 的 InstanceReportSource,例如:

// 创建一个新的报告 Telerik.Reporting.Report report = new 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;
于 2013-06-03T09:11:18.773 回答