简体   繁体   中英

SQL Server 2014 Reporting Services - business object as data source

I'm trying to get reporting services on asp.net working for the first time. I want to use my existing .Net business object library as the datasource. The objects I wish to use as datasets are all collections created using "Inherits List(Of ", eg

Public Class clsBooking Inherits List(Of clsBooking)

After instantiating a ReportViewer control, I can successfully select my .Net library as the datasource and then a list of datasets appears as expected. I can't work out why some are appearing in the list and not others - they are all created using "Inherits List Of(". (Of course it is the ones I need which aren't appearing!) I can't find any good information on what exactly is required in the business object to make it usable as a dataset, just that it must be Enumerable.

After hours of faffing and frustration, I worked out that objects only appear in the Report Wizard list of available datasets if they contain a constructor without any parameters (ie Sub New()). So even if you only want to use the constructor with the parameters, you still must create a useless waste-of-time parameter-less constructor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM