【问题标题】:List<Dictionary<string,string>> bounding to telerik reportingList<Dictionary<string,string>> 绑定到 Telerik 报告
【发布时间】:2013-06-01 06:46:46
【问题描述】:

我的代码是:

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;

环境是银光 我要展示的是:


   a1       a2           a3

zhuwei          zhanglong       zhaoguang

zhuwei1        zhanglong       zhaoguang

那么,怎么解决呢?

【问题讨论】:

    标签: silverlight list dictionary telerik-reporting


    【解决方案1】:

    您可以使用 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;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-04
      • 1970-01-01
      • 2014-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多