Report Views

Thread is closed for posting
2 posts, 0 answers
  1. Brandon
    Brandon avatar
    20 posts
    Member since:
    Nov 2007

    Posted 27 Dec 2008 Link to this post

    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?
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 29 Dec 2008 Link to this post

    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.
Back to Top