This is a migrated thread and some comments may be shown as answers.

LINQ and Reports

1 Answer 184 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Landon
Top achievements
Rank 2
Landon asked on 10 Nov 2010, 04:43 PM
Hello,

I am fairly new to using Telerik Reports and was wondering if it is at all possible to use LINQ as a DataSource for these reports. My end goal is to call an IQueryable Function, while passing in a Username and Time Period to generate the Report for that User.

public static IQueryable GetUserReport(int UserID, string Period)
        {
            DataContext Data = new DataContext();
            var Reports = (from c in Data.UserInfo
                         where c.UserID == UserID && c.Period == Period
                         orderby c.UserID ascending
                         select c);
 
            return Reports;
        }

I have tried using SQL DataSources in my Reports, but would prefer to use LINQ if at all possible. Do Telerik Reports support the use of LINQ, or am I spinning my wheels on this one?

EDIT: Note, I am currently using what I believe is the newest version:
Telerik Reports: 2010.3 1110
RadControls for ASP.NET + AJAX:  2010.3 1109

Best Regards,

Landon

1 Answer, 1 is accepted

Sort by
0
Tomas
Top achievements
Rank 1
answered on 10 Nov 2010, 07:52 PM
Hi,

You can use Linq to Entities and use the EntityDataSource. Take a look here:
http://www.telerik.com/help/reporting/entitydatasource.html

Tomas
Tags
General Discussions
Asked by
Landon
Top achievements
Rank 2
Answers by
Tomas
Top achievements
Rank 1
Share this question
or