You may also be interested in: the only cloud-based Dev/Test solution for SharePoint by
CloudShare
Editor's note: Contributor Melick Rajee Baranasooriya is
a Senior Software Engineer at IronOne Technologies. Follow him @MelickRajee
The following steps will allow you to join multiple listd together and create
a combined view. For example, assume that you are managing a list for some
events. You also have a separate participants list. Now you want to join the two
lists and create a composite view.
SharePoint 2010 allows you to create this kind of view using Linked Data
Source. With this approach you can create your own custom list in
SharePoint.
How to Create a Linked Data source
Go to SharePoint Designer and go to the link called
data
sources.
Click the
Linked Data Source button in the ribbon.
SharePoint designer will prompt the following dialog.
Add the two lists that you want linked together.
I'm adding airline schedule and booking list. These are the two lists that I
want to merge. Click next and it will guide you to another screen. You will be
asked to select either
- Merge
- Merge is used to combine lists which have the same column definitions. For
example we can say this is like a Union operation in the
database.
- Join
- Join operation is used to link two or more lists. The lists do not need to
have the same column definition. This is equal to join operation in the
database.
I need to join the two lists to get the passengers for a particular schedule.
I will use the join option and click finish.
Then switch to the general tab and give a name to identify the data
source.
Now you are done with the linked data source.
How to create a custom view using linked data source in the
SharePoint designer
I'm going to create a custom aspx in SharePoint Designer and create a view
for it. Go to
Site Pages and create new aspx file.
In Designer you can now see an empty aspc file.
You can now add the data source into the page. There are many ways to do
this. The best choice is to Insert and then select your data source to add to
the page. I've found that it is not always visible in the data source task pane
so you you will have to go to Data View and add your data source.
This action will generate a table in the page. But we don't need it so we'll
delete it. We will want the data source in the data source task pane. (Select
all and press delete on the key board.)
Go to the task data source pane and select the columns you want to add to the
page. Click add as a multiple view item.
style="text-align: center">
This will generate a table for you. Click the right most column, go to table
and add a new column to the right as seen below.
Now,
place the mouse cursor to the column and select the
second list in the data source pane and select the columns you want and click
Join Sub View.
Then it will ask for the relation between columns to Join (like foreign key).
Here link data using ID of the Airline Schedule.
Note: Sometimes the Join Sub view will not appear. In order to see
it, click two or more columns. I don't know why this occurs but it has happened
to me several times. And this is how I managed to solve the problem.
Now you can see a composite list view in the page that you can use for ...
No comments:
Post a Comment