I've reviewed this:
http://community.devexpress.com/blogs/garyshort/archive/2010/09/22/xpo-stored-procedure-support-coming-in-v2010-vol-2.aspx
and searched the support portal. But I'm still unclear if, in XAF, I can map a stored procedure that takes one or more parameters to a ListView.
Is this possible?
Can the resulting listview be filtered/grouped/sorted/charted/pivoted just like a normal view?
Do you have any support documents/tickets that illustrate this?
Also, I'm aware of the approach to use a database view with 'Instead of' triggers to allow for updating, but in my situation I cannot access a view directly - I can only access a stored proc - how may I update the database with changes made to the sproc populated ListView?
Thanks,
Chris
We have closed this ticket because another page addresses its subject:
XAF - How to show data from Stored Procedures (SP) in a ListView or DetailView using Non-Persistent Objectsmap a stored proc with parameters to a listview
Answers
Hi Chris,
If you wish to call your stored procedures (with parameters) directly, you can obtain the result set either as XPDataView or as a collection of non-persistent objects via the ExecXXXIntoObjects wizard-generated method (where XXX is a stored procedure name). Then, you can either manually populate a list view with non-persistent objects (see the How to: Invoke a List View for a Non-Persistent Class article) or create a custom CollectionSourceBase descendant that wraps XPDataView. See XAF - How to show data from Stored Procedures (SP) in a ListView or DetailView using Non-Persistent Objects
To update the database via a stored procedure, create a custom Save action that will execute your procedure via the Session.ExecuteSproc or Session.ExecuteNonQuery method.
See also:
stored procedure in 10.2.2.
Thanks,
Michael.