Thursday, 6 February 2014

Data View Web part is a great way to display data with filtering, grouping, and user desired formatting.  It was the most useful webpart in SharePoint 2007 and now has been improved to a great extend in SharePoint 2010.  In SharePoint 2010 you now have a  XSLT Listview webpart and a Dataview webpart (Old one).
XSLT Listview webpart  – XSLT Listview webpart is a ListView whose XSLT can be modified in SharePoint designer.  With this you now have some advanced formatting options and can also use all the filters,sorting grouping etc features that a Dataview wbepart had in SharePoint 2007.
DataView Webpart – Even after all the great features that XSLT Listview webpart has offered, i would still prefer to work with the old Dataview webpart’s XSLT if i have to. The OLD dataview webpart is still available and can be used in the same manner as we used in SharePoint 2007. To add a Dataview webpart onto a page follow the steps below.
1. Open your SharePoint Page and in Site Actions select ->Edit in SharePoint Designer.
2. Now select a zone on teh Page where you want to add your Dataview weboart.
3. Next, click on Insert tab -> click on Data View.
4.  In the drop-down of Data view menu click on “Empty Data view” . This will now insert an Empty Data view in your selected zone.
5. Next click on “click here to select datasource” to select the datasource or list.
6. Select the list\library you want to display the data from.
7. Next drag and drop the columns in the dataview webpart from the right hand column list (for the list\library you selected).
You now have the Dataview webpart on your page. You can now use the formatting options available on your ribbon or can modify the XSLT either in Designer or on the page itself by editing the webpart properties in the Browser.

Here I am showing you how to create a simple data view web part to display data from SharePoint list. It has filter and grouping enabled.

I am taking the example of a Task list here. I am creating a data view to display data from this list to a data view web part.

1. First of all you have to open your web application in share point designer. Open the page where you want to insert data view.

  image1.gif
2. Click on Insert -> Share point Control -> Data view.

image2.gif

3. From the Data source library select the list you want to add to data view web part and click on Show data.

image3.gif

4. Select the fields you want to insert to data view web part.

image4.gif

5. Drag the selected Item to your page web part zone.

6. Click save You will get the data view as shown below.

image5.gif

7. Right click on the web part and click on show common controls.

image6.gif

8. From the pop up select Data view properties.

image7.gif

9. Please select the filter and grouping options.

image8.gif

10. Go to Editing tab and select the options you want.

image9.gif

11. Alternatively you can select paging properties in the Paging tab.

image10.gif

12. Check in your changes and open your page in browser.

13. Now you can see your Data view web part with filters,groups,Edit,Delete and Insert options.

image11.gif




Few Terms:
  • Site Template
    • Site template refers to WSP package, which was created by clicking the Save Site As Template link in the Site Settings page. In SharePoint 2007 sites were saved to specific STP format, but in SharePoint 2010 templates are using the standard SharePoint solution package model.
  • Web Template
    • Web template refers to new feature element available in SharePoint 2010, which provides us flexible way to define definition (onet.xml file), which will be used only on provisioning time, when the site is created. There are no references to the definition on runtime, which provide easy maintainability for the definition.
  • Site Definition
    • Site definition refers to classic WebTemp*.xml and onet.xml combination, which are located in the file system of server. WebTemp*.xml file is used to introduce the template for SharePoint and onet.xml file contains the actual instruction or definitions concerning which features to activate when site is created.
  • Portal site template
    • Portal site templates are hierarchy files, which are available when you use SharePoint server. Portal site templates have their own xml schema, which is used to define which kind of site definitions are provisioned and in which order. Good example of portal site template is out of the box publishing portal definitions, which provisioned example www site, with single sub site.

No comments:

Post a Comment