Can a "view" be created in LightSwitch Application? RRS feed

  • Question

  • It's there a way to create a 'view' in LightSwitch using the UI (outside of using LINQ)? I am not referring to the normal view that can be created on the external database and imported into LightSwitch...

    Giving the ComponentOne OLAP Tool a quick tryout, and I cannot seem to get data from two related entities into the same OLAP screen/fields.

    I know it's posibble to use the dot operator to pull the data from the related table, but is there a way to pull together the data from the related tables into new entity/view instance?

    Thank you.

    Sunday, July 24, 2011 3:40 PM


All replies

  • Simple answer, no, not in V1, unless you use RIA Services to create your "combined" entities.

    Have a look at Eric's article, "How Do I: Display a Chart Built On Aggregated Data", for the techniques you'd need (& to see how easy LS has made it to consume RIA services)


    (plus ça change, plus c'est la même chose!)

    Monday, July 25, 2011 12:35 AM
  • Yann,

    It's just strange that this is apparently so simple but LS did not include it, and none of the third party plug-ins I have seen so far are providing any solution for this 'important' and 'basic' need.  

    Last I checked, SQL is still a Relational Database!  Why anybody thinks you can make do with analyzing single tables in a LoB is still difficult for me to comprehend.  I consider myself more of a business user than a programmer and ideally would not like to spend too much time on stuff that should have been there in the first place.

    July 26th is just around the corner.  Let me wait till Tuesday and see. 

    I checked out the ComponentOne OLAP for LS and it seems it cannot in a straight forward way work with more than single entity.  I was very impressed but disappointed that there is no preview or ability to export to excel.

    $295 here, $199 there, $99 over there ... Not a lot, the problem is you may still have gaping holes in functionality and cohesiveness. 

    Monday, July 25, 2011 1:32 AM
  • It seems to me the most bang for buck would be allow anonymous type sets, understanding they will be disconnected and free floating. With these we can fill a list with View data or IEnumerable<T> or IQueryable<T>, or anything else and fill grids or UI.  Can also use to manually enumerate and do manual updates back to db.  This way, you don't have to deal if views are updateable as we side step the issue in a clean way (more or less).
    Monday, July 25, 2011 3:48 AM
  • @Cromanty:  I'm curious to know what you mean by a "view".  

    Are you looking for 1)  a screen that doesn't update or 2) a series of related tables that the user only has ReadOnly permissions on at the LS Entity level.

    Or 3) a screen that has some Groups that have non-editable fields? 

    Or . . . something else - like perhaps dynamically creating controls in Groups that are read only.

    Monday, July 25, 2011 9:24 PM
  • Garth,

    I am looking for a way to build a temporary temporary tables or 'views' that will have the ability to for instance bring in all the fields on a the tables being selected from (or any number of selected fields).

    For instance if I have Products table that is related to an OrderDetail table, the Order Detail Table is related to the Order Header table.  The Order Header table is then related to Customer, and so on.

    The view in the case will be like puling all the fields from Products, OrderDetail, OrderHeader, Customer and then being able to group them by any of the fields.


    Tuesday, July 26, 2011 1:42 AM
  • If you want a temporary table you can do so by creating an in-memory table as demonstrated in Michael Washington's article here: http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/10/LightSwitch-Student-Information-System-Part-3-Custom-Controls.aspx

    Hope this helps,

    Steve Hoag Microsoft aka the V-Bee
    Tuesday, July 26, 2011 2:20 AM

  • Thank you Steve.  The technique Michael showed there is nice and I can see using it in some future application.  However, there was a lot of code, C#, xaml, etc.  for it to be used for simple 'stuff' or by your average business user.

    What I was looking for is the ability to create something equivalent to a "view" in SQL Server, then have the ability to use if to create multiple screens, without having to set up / or the fields every time.  Can you imagine the power that ComponentOne's OLAP for LS tool will have if this possible in LS?  It will be much easier creating reports too.

    Please see the screen shots I have posted here if you have the time (for whatever reason, pictures not in sorted order): http://s1221.photobucket.com/albums/dd480/Cromanty/LS%20Suggestions/


    I have also posted it to the MS Connect site for LightSwitch. 


    This will significantly increase the already immense potential LightSwitch has.

    Please vote for it, maybe we can get it in just in time for v1 today :)


    Tuesday, July 26, 2011 9:34 AM
  • Hi

    This suggestion was also registered in connect, if you want to support it.  Full Data Model


    Tuesday, July 26, 2011 2:43 PM