如何使用aspx将数据表与水晶报表中的未绑定字段绑定

时间:2016-04-05 16:10:52

标签: c# asp.net silverlight crystal-reports

我正在使用包含unbounds字段的aspx页面中的crystal report。我的问题是我想绑定一个数据表,该数据表有两列,并由我在crystal报表中用两个未绑定字段处理的存储填充,我不知道将unbounds字段与datatable绑定。我已经阅读了一些教程,但它们总是在设计时将其与数据集绑定。我想通过page_Load事件中的代码手动绑定它。你能帮我个忙吗?谢谢你的帮助! 这是我的page_load事件,它没有在我的数据表中显示任何行:

 protected void Page_Load(object sender, EventArgs e)
    {

        crystalReport = new ReportDocument();
        string passedValue = Request["testValue"];
        crystalReport.Load(Server.MapPath("Report\\ProductReport.rpt"));
        DataService service = new DataService();
        DataTable tbl = new DataTable("Product");
        tbl = service.storeGetAllProduct();
        crystalReport.SetDataSource(tbl);          
        this.CrystalReportViewer.ReportSource = crystalReport;
        this.CrystalReportViewer.RefreshReport();
    }

这是我的水晶报告的图片我已经拖放了未绑定的字段: My crystal report

0 个答案:

没有答案