This is a migrated thread and some comments may be shown as answers.
Report Views
1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brandon
Top achievements
Rank 1
Brandon asked on 27 Dec 2008, 10:29 PM
I noticed that there are currently plans underway to better integrate OpenAccess with Telerik Reporting.  I am excited to see how this will work.  In the meantime, I need to get some reports working right now. 

I have a view in my database that I use for reporting.  It gathers values from multiples tables, joins them together and returns a linear result set.  For example, the following returns a customer's id, first name, last name, order number, order date and product by joining data from three tables:

select   
  c.Id, c.FirstName, c.LastName, co.OrderNumber, co.OrderDate, coi.Product  
from   
  Customer c  
inner join   
  CustomerOrder co on c.Id = co.CustomerId  
inner join   
  CustomerOrderItem coi on co.Id = coi.CustomerOrderId  
where   
  co.OrderDate between @StartDate and @EndDate  
order by   
  co.OrderDate, c.FirstName, c.LastName  
 

Forgive me if this is already documented.  However, I cannot seem to find any proper documentation or examples on how to handle this scenario.  Do I somehow create a read-only class that has the same fields that are returned by the view?

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 29 Dec 2008, 01:13 PM
Hello Brandon,
Views are not yet supported by OpenAccess ORM but this is one of our main tasks for the near future. This feature will be available by the beginning of 2009. For now you can workaround this by querying the same results using, for example, a Linq query.

var x = from scope.Extent<CustomerOrderItem>() as coi where coi.Order.OrderDate >= startVar and coi.Order.OrderDate <= endVar select coi;

You just need to have two local arguments startVar and endVar or type DateTime.

Regards,
Zoran
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Brandon
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or