locked
How to transfer LS computed property result to a property that can be saved in a database ? RRS feed

  • Question

  • Hello, can someone help me out how to use computed property result in generating reports. Bcoz it seems to me that LS computed property result is not stored in database that y not visible when generating reports using SSRS. And when using LS as a service, computed properties are not accessible in power pivot for data analysis.
    Monday, July 15, 2013 6:38 AM

Answers

  • The whole idea of computed props is indeed that they are calculated on the fly and that they are not persisted in the db. Note that you can't use computed props in the html client. 

    In your particular case, where you want to have the value of the computed props in power pivot, i would suggest to write a ria service which simply executes a projection of your data to a data transfer object. (a one to one mapping) When you map a computed prop field, the value will be calculated and stores in the corresponding field in the DTO (data transfer object).

    By doing so, the ria service (consumed server side in LS) will be exposed as as separate service, which power pivot can consume.


    paul van bladel

    • Proposed as answer by babloo1436 Monday, July 15, 2013 8:19 AM
    • Marked as answer by Salman Tarique Monday, July 15, 2013 1:43 PM
    Monday, July 15, 2013 7:38 AM

All replies

  • The whole idea of computed props is indeed that they are calculated on the fly and that they are not persisted in the db. Note that you can't use computed props in the html client. 

    In your particular case, where you want to have the value of the computed props in power pivot, i would suggest to write a ria service which simply executes a projection of your data to a data transfer object. (a one to one mapping) When you map a computed prop field, the value will be calculated and stores in the corresponding field in the DTO (data transfer object).

    By doing so, the ria service (consumed server side in LS) will be exposed as as separate service, which power pivot can consume.


    paul van bladel

    • Proposed as answer by babloo1436 Monday, July 15, 2013 8:19 AM
    • Marked as answer by Salman Tarique Monday, July 15, 2013 1:43 PM
    Monday, July 15, 2013 7:38 AM
  • Thanks Paul.

    Can I use the WCF RIA Service generated by DevExpress Xtrareport in Lightswitch for this purpose (in Power pivot analysis)? Will it provide same functionality which I want?

    Monday, July 15, 2013 3:21 PM
  • You are welcome Salman.

    Sorry, not familiar with the devExpress extension.


    paul van bladel

    Monday, July 15, 2013 3:36 PM