How to join 2 lists with dataview webpart in sharepoint designer

本文介绍如何在SharePoint中通过使用数据视图WebPart将两个列表(Mylist01和Mylist02)进行联合操作,具体步骤包括创建WebPart页面、设置数据源、添加数据视图WebPart及实现列表联合。

 

HeavyMetal, 2009/8/28

To facilitate the description, I create two list and two simple content type:

List:Mylist01

Contenttype: mycontenttype01

Field: Title

Field: OB_ID

image001

List: Mylist02

Contenttype: mycontenttype02

Field: Title

Field: OB_ID

Field: mystatus

image003

Now, we need to join the 2 lists using the id field “OB_ID”, so we can the object’s status

Step 1: create a webpart page and add a data view webpart in SPD

1) Create a webpart page

image005

2) edit in SPD, in the data source library create a data source

fill the name:

image007

Add the two list to the data source wizard:

image009

Click next step, select the second option

image011

Click finish:

image013

Click ok and quii.

3) Add the dataview webpart

Select “myjoinlist” and right click, in the pop menu, select display data:

image015

In mylist01, drop the title and OB_ID to the webpart area:

image017

Save the page, and refresh the page in the IE, you can see the data in mylist01 displayed.

image019

Step 2: Join the 2 lists

Continue the editing in SPD, click the button in the top-right corner of the webpart, and select edit column, then add a formula column:

image021

Select the mystatus column in mylist02, double click and then move the cursor to the end of the “Row”, input a “[”, and select “@OB_ID”, select “all” in the function type, and double click current, add a “/”, and select “@OB_ID”, then input a “]”, click OK, and then click OK in the Edit colomn dialog.

image023

image025

Save the page, and refresh the page in IE.

We can get the joined list as follows

 

 

 

 

 

 

 

 

 

 

 

 

 

image027

转载于:https://www.cnblogs.com/HeavyMetal/articles/1557238.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值