更新时间:2023-02-24 12:56:08
从您的描述和随附的代码来看,ReportData
类中没有任何属性.如果我认为正确,该类应该生成要在报告中显示的 IEnumerable
.
From your description and accompanying code, there are no properties in the ReportData
class. If I reckon well, that class is supposed to be generating the IEnumerable
you want to display on the report.
如果是这种情况,您必须在向导中选择 Employee
类作为数据源.这将允许您在报告中显示数据.
If that's the case, you'll have to select the Employee
class as the DataSource in the wizard. This will allow you to display the data on your report.
我将处理一个快速项目,稍后将其添加到此答案中.
I'll work on a quick project and add it to this answer in a moment.
编辑 1
Visual Studio 2008
Data
> Show Data Sources
Data
> Show Data Sources
Visual Studio 2010
View
> Report Data
New
> Dataset...
.创建新数据源或选择现有数据源.
View
> Report Data
New
> Dataset...
on the Data Sources window.Create a New Data source or select an existing data source.
创建新数据源
将类绑定到报表后,继续像往常一样设计报表.
After binding a class to the report, go ahead and design your report as usual.
编辑 2
我为您上传了一个示例项目.这是 链接.
如果您需要进一步说明,请通知我,以便我为您提供有关如何复制项目的分步程序.
I uploaded a sample project for you. Here's the link.
If you need further clarification, please notify me so I give you a step by step procedure on how to replicate the project.