Monday, August 25, 2014

Working with linked Data source



Link data source have two options
I. Merge
II.Join
Merge:  we can merge two or more lists when these lists have same set of fields.
Join: we join lists when two separate lists have one field in common.
Steps to work with linked data source:
I.Merge
Step1: Create two lists employees and customers which is having same columns like Title, First Name, Last Name, Mobile, Country,State  and City and Insert few records into both lists.
Step2: Create Linked data source using above two lists.
i.                    Open SharePoint designer using required site URL(ex: http://localhost:8085/sites/QualitySystems)
ii.                  Click on data sources on the left side pane.
iii.                Next click linked data source   
          Screen:1    

        Screen:2                         
       Screen:3



iv.   Click on general tab and give the data source name as CombineTwoList view


v. Select Source tab and click on Configure linked data source and select customers list 
    click on add button. Similarly add employees list 


 
                                                    
 
 Click on finish button.   now linked data source is created Successfully.


Step3:  i.Create Document Folder :
             Create one folder for storing  views pages in Site Pages.
             Click site pages next click on the Folder and give name to the folder as         myweparts          
                                   
             ii. Create webpart Page: 
                 Click On Folder i.e.MyWebparts next click webpart page on Top of Ribbon   
                  and Select any one of web part page layout , give names test.aspx 
           
             iii.Right click on test.aspx click on Edit in Advanced mode 
                                     


               iv. Select Insert tab next click on data view and select more data sources 


                          


                              


                       v. Select the required data source from linked data sources and click OK.
               


             
                             
vi.   In the above page is not displayed required fields so that click on Options
    next click Add/Remove columns and give required display fields and 
    click on OK button.
 

             
             vii.Click on Preview button it displays two lists data as follows.
                    
Step4:Applying the grouping 
                        

     Click on OPTIONS on the top of the ribbon next select Sort & Group     
     Select Group field name and show group header  as follows .
       click on Ok button it displays next screen.

   

           Step5: Paging 
                       Click on paging on the top of the ribbon next click on more paging Options
                     
                            Select the Display items in sets of the size and click on OK button.
                                                       
                          click on preview button.
    
              if page button is not move then deselect asyschronus on the top of the ribbon.

Step:7:Filtering
                          Click filter on the top of the ribbon it displays one popup in the popup
                          select  required  filtered critiria (ex:filter city ='hyd') and click on OK.
                          it displays hyd city records as follows.
                                
  
  Step 8: Sorting 
               Click on Design on the top of the ribbon and check sort & Filter on headers 
              observe field title /display name shoudn't other field
                          Note : for the datetime give isodatetime in the fieldtype and datetime is date only.
                     click on preview.
Development: 

       i. Remove hyper links/look up field hyperlink
         <'xsl:value-of select="substring-before(substring-  after(@country,'>'),'<')" disable-output-escaping="yes" />

      ii.display html to text
         <'xsl:value-of select="@description" disable-output- escaping="yes" />
      iii.display DateTime format (MM/DD/YYYY):
            ddwrt:FormatDate(string(@Created), 1033, 1)
     iv.Two dates Difference:
         <'xsl:value-of select="(number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(@Due_x0020_Date)))) - number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:TodayIso()))))) div 864000000000" />
    v.if else conditons  
       two fields values are checked using bellow code write this code in to td directly
    vi. navigation link to display form
        <a  href="{@FileDirRef}/{'display.aspx'}?ID={@ID}"
           onclick="GoToLink(this);return  false;" <               
                     <xsl:value-of select="@NotesAuthor" />
                    </a>
   vi.Instead of group empty value give constant Name:( Not Categorized)
                 <xsl:choose>
                                  <xsl:when test="$fieldvalue=''" >
                                 Not Categorized
                                 </xsl:when>
                                 <xsl:otherwise>
                                     <xsl:value-of select="$fieldvalue" disable-output-escaping="yes" />
                                </xsl:otherwise>
                             </xsl:choose>
                
                
              

                   
                 
              
       
              
    














                       















No comments:

Post a Comment