Report Designer - how to add ObjectDatasource?
I am trying to add a local report to my ASP.NET 2.0 app.
When I create new datasource in VS report designer it always creates SQL Datasource (it doesn't even ask me about the name of the dataset).
I am going to use my business objects as a source of data, so it would help to be able to use them when I design the report. I don't need that DataSet1.xsd in my project. I just want to use my own objects.
Is there any way to do that in the report designer?
From Website menu choose Add New Item. Click Class, enter a name for the source file, and click Add. You are asked if you would like to place the class in App_Code folder. Answer yes. Then enter the code in the link below.
Notice that there is a class (Product) with public properties that act as the "fields", and there is another class (Merchant) that has a "select" method (GetProducts()) that returns a collection of the former class. This is a requirement for object data sources in websites (In WinForms projects only the Product class is required.)
Build the code, then add a Report to the website. Press the refresh button in the Data Sources window, and the Product object should appear. Unlike in WinForms projects, there is no Add Data Source step for object data sources.
http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/rs_vsrpts/html/1261f8f9-c491-430d-8f1f-7cb7feef2ddd.asp