Fetch data from multiple sharepoint lists
-
2012年6月21日 下午 03:01
I want to fetch data from multiple lists(3 or 4) based on Unique number (say RequestID).
For eg. two columns from List1, two columns from List2, two columns from List 3 based on specific RequestID.
Final result should be 1 single row with desired columns which i will bind to grid or some other control.
Any help will be highly appreciated, i am badly stuck :(
Thanks,
Saurabh
所有回覆
-
2012年6月21日 下午 03:16
Saurabh,
It would have been good if you could have specified how you want the solution to be, so there are couple of options how you can get this working
1. SharePoint Designer - Link Data Source (Display data from multiple sources in a single Data View)
http://www.codeproject.com/Articles/194252/How-to-Link-Two-Lists-and-Create-a-Combined-Ciew-i
2. Out Of the Box - Content Query WebPart
3. Custom WebPart Solution
Using SPSiteDataQuery
http://mossbykarthikg.wordpress.com/2010/06/28/spsitedataquery-retrieve-data-from-multiple-lists/
http://www.codeproject.com/Tips/401818/SharePoint-2010-SPSiteDataQuery-with-Example
Let us know if you are facing any issues.
Thanks
Akhilesh Nirapure -
2012年6月21日 下午 03:16
Hi Saurabh,
Use CAML query or LINQ
refer for more detail Fetching Result From Multiple sharepoint lists using CAML QUERY
Thanks
- 已編輯 Ashar2k11 2012年6月21日 下午 03:17
-
2012年6月21日 下午 03:38SharePoint 2010 is providing this feature where we can use the data of one lint into another. Not sure for more than two list.
-
2012年6月22日 上午 04:52
Hi Akhilesh,
Thanks for the response, but i have seen these links but none of them works for particular ID in our case RequestID.
Let me know if you have any idea for fetching results from different lists based on ID.
Thanks,
Saurabh
-
2012年6月22日 下午 04:08
Saurabh,
I would recommend you to read about Lists (Definition), SiteColumns and ContenType. This will give you an overview how these core components are setup, and then i would become really easy for you to understand how you can form CAML queries to fetch.
http://msdn.microsoft.com/en-us/library/ms477863(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/ms426449.aspx
Thanks
Akhilesh Nirapure- 已標示為解答 Daniel YangMicrosoft Contingent Staff, Moderator 2012年6月29日 上午 05:31
-
2012年6月23日 上午 04:24
As you want to get data from the multiple lists which have a common fields name RequestID.
If all the lists of the same base template then we can use SPSiteDataQuery.
But as these are of different base templates then we can use Joins in CAMl Query.
For how to implement join you can have a look at
http://yogeshlotlikar.wordpress.com/2012/02/17/caml-query-joins/
Hope this will help.
Sharepoint Sutra
Sharepoint Consultant- 已標示為解答 Daniel YangMicrosoft Contingent Staff, Moderator 2012年6月29日 上午 05:31
-
2012年7月11日 下午 02:24Linq is the best choice to cusomize any type of complex query.
VV

