How To: Customize the View for External Lists

SharePoint 2010

Learn how to customize the appearance of External Lists by using Microsoft SharePoint Designer 2010.

Last modified: December 06, 2010

Applies to: Duet Enterprise for Microsoft SharePoint and SAP Server 2.0 | Office 2010 | SharePoint Server 2010

After you create an External List, you can use Microsoft SharePoint Designer 2010 to change its appearance either by applying a view style or by directly customizing list columns. You can apply view styles either by using the SharePoint Designer 2010 user interface or by editing the underlying XML schema for the External List. The procedures in this topic demonstrate how to make both kinds of changes to External List views by using SharePoint Designer 2010.

To customize the view for an External List by applying a view style

  1. View the External List in your browser to see its current appearance.

  2. In SharePoint Designer 2010, on the the File menu, click Open Site.

  3. In the Open Site dialog box, type the name of the URL of the site that contains the External List, as shown in Figure 1.

    Figure 1. Open site in SharePoint Designer 2010

    Open a site in SharePoint Designer
  4. In the Open Site dialog box, click Open.

  5. In the left Navigation pane, click Lists and Libraries, and then select the External List that you want to customize. In this example, the name of the External List is Customer Inquiry.

  6. In the Views box, click the view that you want to customize. This example contains only the Customer Inquiry Read List view, as shown in Figure 2.

    Figure 2. Customize the list view

    Select al list view in SharePoint Designer
  7. To customize the view by applying a view style, click the Design tab at the bottom left of the page and select a view style. In this example, we select the Boxed style.

    To customize the view by editing the XML schema, click the Code tab at the bottom left of the page, and edit the XML directly, as shown in Figure 3.

    Figure 3. Select the code view

    Select code view in SharePoint Designer
  8. Edit the XML schema manually in the code view of SharePoint Designer 2010. The following example demonstrates how to apply the Boxed style by applying the correct ID property for the ViewStyle element.

    <View Name="{F9D5B839-B81B-4E47-8232-DF62DDD65C98}" ….>
    <Method Name="FindCustomerInquiryByElements"/>
                <Query>
                   <OrderBy>
                      <FieldRef Name="InquiryHeaderId"/>
                   </OrderBy>
                </Query>
                <ViewFields>
                   <FieldRef Name="InquiryHeaderId"/>
                   <FieldRef Name="ShipToPartyDesc"/>
                   <FieldRef Name="SoldToPartyDesc"/>
                   <FieldRef Name="Datetermsrequestdate"/>
                </ViewFields>
                <RowLimit Paged="TRUE">30</RowLimit>
                <Aggregations Value="Off"/>
                <Toolbar Type="Standard"/>
                <ViewStyle ID=”17”/>
             </View>
    
  9. Click the Save button at the top of SharePoint Designer 2010 to save your changes. View your changes to the External List view in the browser.

To customize the date column of an External List

  1. View the External List in your browser to see its current appearance. In this example, the Datetermsrequestdate column displays both the date and the time, as shown in Figure 4.

    Figure 4. External List with date and time column in browser

    External List view in browser
  2. In SharePoint Designer 2010, on the File menu, click Open Site.

  3. In the Open Site dialog box, type the name of the URL of the site that contains the External List as shown in Figure 5.

    Figure 5. Open site in SharePoint Designer 2010

    Open a site in SharePoint Designer
  4. In the Open Site dialog box, click Open.

  5. In the left Navigation pane, click Lists and Libraries, and then select the External List that you want to customize. In this example, the name of the External List is Customer Inquiry. Select the list view that you want to edit.

  6. Right-click the Date column of the External List and select Edit formula.

  7. To display the date only, replace the default formula with the following formula.

    substring-before($thisNode/@*[name()=current()/@Name],' ')
    

    To display the time only, replace the default formula with the following formula.

    substring-after($thisNode/@*[name()=current()/@Name],' ')
    
  8. Click the Save button at the top of SharePoint Designer 2010 to save your changes. View your changes to the External List view in the browser.

    Figure 6 shows the External List view that displays the date only.

    Figure 6. External List displaying date only

    External List view in browser with date only

    Figure 7 shows the External List view that displays the time only.

    Figure 7. External List displaying time only

    External List view in browser with time only
Show: