【发布时间】:2014-06-19 11:33:29
【问题描述】:
我有一个从数据集创建的 Crystal Report。我使用 IEnumerable 加载它的 DataSource。
我这样做是因为我已经有一个 ComponentModel.BindingList(Of Customer) 作为列表框的数据源,所以我可以避免双重访问数据库。
我使用以下代码加载报告:
LoadReport("crCustomers.rpt", lstCustomers.DataSource)
Private Sub LoadReport(ByVal ReportName As String, ByVal ReportData As IEnumerable)
'Load desired report
Dim report As New ReportDocument
report.Load(ReportName)
'Load the data into the report
report.SetDataSource(ReportData)
'Set the report into the viewer
crvReportViewer.ReportSource = report
End Sub
它适用于所有单一数据源报告,但现在我必须面对一个显示订单数据的报告以及与 FK Order(Id)-OrderDetails(订单号)。
如何加载两个 IEnumerable 作为数据源?
【问题讨论】:
标签: .net vb.net crystal-reports datasource ienumerable