Report printing from Custom Collection class possible? RRS feed

  • Question

  • Is it possible to give a custom collection class methods that will allow it to be accessed as though it were a datatable/view for use by a report printer such as Crystal reports?

    Seems like I reinvent printing every time I write a new app, but the fundamentals always involve a custom class of objects. I'm thinking that if I give my object the ability to appear as a table/view I can use CR (or another report system) a way to access the data.

    Tuesday, July 3, 2012 4:32 PM


  • If you implement System.Data.IDataReader or inherit from either System.Data.DataTable or System.Data.DataSet, then you should be able to pass the object to the SetDataSource method of the ReportDocument instance.  I recommend using typed datasets for sets of data, if possible.  Not sure how else you can populate a Crystal Report without some sort of data set or data connection.

    Tuesday, July 3, 2012 4:41 PM