Does the asp.net ReportViewer control work with LinqDataSource? If so are there any examples out there?
Why don’t Linq to Sql generated entity classes show up in the Website Data Sources pane, when editing a report?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It appears the Website Data Sources pane will only show you all classes that have public methods that return IEnumerable, but it won’t show properties, even if they also return IEnumerable. For example, if you have this class:
Then the only option that will appear in the Website Data Sources pane is “GetNamesList” with the properties FirstName and LastName. Since your Linq-to-SQL generated classes have properties that are IQueryable, but not methods, you might want to add partial classes that have methods to expose these collections. So if you have a Products property, create a partial class with a signature of:
public IEnumerable GetAllProducts();
But I’m not sure that you can make the ReportViewer work with an existing LinqDataSource control. Instead, it basically does the same thing as the LinqDataSource: instantiates a class and calls the method you specify to get data.
Helpful Links:
http://msdn.microsoft.com/en-us/library/ms251692(VS.80).aspx
http://forums.asp.net/p/1430385/3667394.aspx