我正在使用devExpress XtraReport在VS2013 C#winform应用程序中创建报告。我正在尝试使用实体框架中的表作为数据源。我尝试使用绑定源,但数据没有显示。
来自我的dataProvider类:
public static List<vwInventoryRequestReport> GetView(int docNo)
{
var items = new List<vwInventoryRequestReport>();
using (var context = new Sage300Entities())
{
var query = from i in context.vwInventoryRequestReports
where i.InventoryRequestHeaderId == docNo
select i;
items = query.ToList();
}
return items;
}
来自我的主要课程:
var docNo = Convert.ToInt32(teDocumentNumber.Text);
var items = DataProvider.GetView(docNo);
this.bindingSource2.DataSource = items;
InventoryRequestReport report = new InventoryRequestReport();
report.DataSource = items;
ReportPrintTool tool = new ReportPrintTool(report);