报告查看器不显示任何RDLC报告

时间:2016-06-01 11:46:56

标签: c# wpf rdlc

我正在动态创建数据集和数据表以绑定到Report1.rdlc。报表查看器未显示任何内容

        DataSet d = new DataSet();
        d.DataSetName = "DataSet1";
        d.GetXmlSchema();
        d.WriteXmlSchema(@"path + "/ds.xsd");
        d.WriteXml(@"path + "/ds.xml");

        DataTable Table1 = new DataTable();
        Table1.TableName = "TblPackage";

        Table1.Columns.Add("ID");
        Table1.Columns.Add("Name");
        Table1.Columns.Add("Description");
        Table1.Columns.Add("AddedBy");
        Table1.Columns.Add("AddedDate");
        Table1.Columns.Add("UpdatedBy");
        Table1.Columns.Add("UpdatedDate");

        d.Tables.Add(Table1);
        d.BeginInit();
        this.reportViewer.Reset();
        _reportDataSource.Name = "TblPackage";
        _reportDataSource.Value = EcadPackageList;
        this.reportViewer.LocalReport.DataSources.Clear();
        this.reportViewer.LocalReport.DataSources.Add(_reportDataSource);
        this.reportViewer.LocalReport.ReportPath = @"C:\ALF 4.0\CodeBase\ALF\Report\Report1.rdlc";
        d.EndInit();
        this.reportViewer.LocalReport.Refresh();

0 个答案:

没有答案