Introduction
In this article we will explore how to customize the data view web part XSLT and apply different operation implementation in SharePoint 2010.
Scenario:
- When we add a list with SharePoint data view web part, after that when displaying the column @Author (Created by) or Person or Group Column in Data View Web Part (DVWP) SharePoint displays a hyper link.
How to remove person (Author) hyper link from Data view Web part using XSLT Remove person (Author) hyperlink from Data view Web part using XSLT.
Solution:
- In data view web part, Multiline column takes a lot of space.
How to Wrap Multiline Textin XSLT expression?
In the below solution, Description is Multiline Column. So after 180 characters you will see “…”.
Solution:
- In SharePoint, SharePoint List Column Person or Group allows multiple selections. When we add multiple users in that column in data view web part this column displays like: Example. 2; #Akash;3;#Prashantremove special character using JavaScript.
Example:
2; #Akash;3;#Prashant
Output:
Akash;Prashant
- We display Date, but there are times when we have to display the date and time in different formats, so we can achieve this by Customization of the Data View Web part–XSLT.
- <xsl:value-of select="ddwrt:FormatDate(string(@StartDate), [LCID],[FORMAT FLAG])"/>
Format Flag
Format Flag | Example |
1 | MM/dd/yyyy. ==> "08/17/2000? |
3 | dddd, MM dd, yyyy. ==> "Thursday, August 17, 2000?
|
4 | h:mm. ==> "16:32? |
5 | MM/dd/yyyy h:mm. ==> "08/17/2000 16:32? |
7 | dddd, MM dd, yyyy h:mm. ==> "Thursday, August 17, 2000 16:32? |
12 | h:mm:ss. ==> "16:32:32? |
13 | MM/dd/yyyy h:mm:ss. ==> "08/17/2000 16:32:32? |
15 | dddd, MMMM dd, yyyy h:mm:ss. ==> "Thursday, August 17, 2000 16:32:32" |
LCID is a language code:
Reference: List of supported locale identifiers in Word
- How to add a hyperlink/Anchor tag to a particular column in the Data View Web Part by editing the XSLT.
Read more articles on SharePoint: