Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

How to display data from two different sharepoint list. I have an approval system with a task list and a document library. It would be helpful to the users if i put a DVWP that shows the current progress/status of each document in the approval process by linking the two lists as datasource.

I do see an option in Related Data Source > Link to another Data Source... but i didnot find any online resource on how to go about using this feature in SPD 2007. MOSS 2007 application.

Can anyone suggest some reference links or solutions...

Thanks!

share|improve this question

3 Answers

up vote 0 down vote accepted

Display data from multiple sources in a single Data View

Applies to: Microsoft Office SharePoint Designer 2007

http://office.microsoft.com/en-us/sharepoint-designer-help/display-data-from-multiple-sources-in-a-single-data-view-HA010099144.aspx

share|improve this answer
 
Hi, i referred the link. They are using two xml files rather than two sharepoint lists. It is possible to get an xml view of a list and store that temporarily in memory for use.I would really like to know its implications as one of the sources I have is a document library that contains document in mutiple folders like a tree structure.And Is it possible to join the two lists as both of them are actually representing data tables? –  Shankar Apr 21 '11 at 5:42
 
I followed the instruction, I did create the linked data source, but one of my data source is a document library with many folders, when I set the scope property to recursive all for this source, the changes are not getting applied to the linked data source. It doesnot show me the files. –  Shankar Apr 25 '11 at 6:48

You could use a connector which will simplify your development process a lot, in example http://www.bendsoft.com/net-sharepoint-connector/.

With such a component you simply connect to your lists as if they where ordinary SQL tables and select the data you want from each list and output it any way you like.

In example

string query = "SELECT ID, LinkTitle AS Title FROM list";
conn = new SharePointConnection(connectionString);
SharePointDataAdapter adapter = new SharePointDataAdapter(query, conn);

DataTable dt = new DataTable();
adapter.Fill(dt);

Or using a helper method to fill a DataGrid

string query = "Select * from mylist.viewname";
DataGrid dataGrid = new DataGrid();
dataGrid.DataSource = Camelot.SharePointConnector.Data.Helper.ExecuteDataTable(query, connectionString);
dataGrid.DataBind();
Controls.Add(dataGrid);

You can see some more examples here, access list in sharepoint 2007 using c#

How you wish to bake up the data is up to your imagination, but it will simplify your workflow and SharePoint development for sure :)

share|improve this answer
 
Thanks! Your solution is valid only if i am using a custom web part. But here i am using a data view web part and there are options to join two sharepoint list to create a single data source using SPD. I dont want to get into c# for this.I just want to leverage on the existing feature. –  Shankar Apr 20 '11 at 9:12
 
Ah alright, missed that! Good luck then. –  Eric Herlitz Apr 20 '11 at 9:18

If you are looking for a way to put two lists in a single site in a SharePoint data view web part, then Mads Hansen answered your question. However, if you are looking for roll up lists from different sites under same site collection, you may need tools like SharePoint List Collection or go to codeplex to find some web parts. And if you attempting to combine list data from different site collections, which I hope you are not, you need to get your hand dirty and also you may have to compromise data security, at least I did not make that happen:-)

share|improve this answer
 
One is a document library with tree strucutured folders and files, other is the task list. Is it possible to join these two? –  Shankar Apr 29 '11 at 4:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.