Home> SPSRollUp Simple Report

SPSRollUp Simple Report

This is an introductory guide to SPSRollUp to create a simple report

We want to get the status of all pending tasks from all subsites. (Sites that are below the current one).

The list-type tasks, from which we obtain data are called "Tasks" and "Project Tasks", and the fields that we want to show are: The site where the task is in, the task’s name and the completion percentage.

To which we must fill the SPSRollUp properties as follows:

Top Site, leave blank to begin tracking from the level at which we find ourselves.

Lists, enter the lists’ names "Tasks, Project Tasks"

Fields, enter the fields that we want to get, the task’s title (Title) and the completion percentage (PercentComplete)

In the query’s field CAML we will place the following query to display only the remaining tasks.

<Where> 
  <Neq> 
    <FieldRef Name="Status" /> 
    <Value Type="Choice">Completed</Value> 
  </Neq> 
</Where>

Remember that CAML consultations are case-sensitive, and they require a precise syntax. Once the inquiry is introduced, press the button to apply twice.

You will then get results similar to these.

<Rows> 
 <Row> 
   <_ListTitle>Project Tasks</_ListTitle> 
   <_ListUrl>/spsrollup/projectone/Lists/Project Tasks/gantt.aspx</_ListUrl> 
   <_SiteTitle>Project One</_SiteTitle> 
   <_SiteUrl>http://w2k3/spsrollup/projectone</_SiteUrl> 
   <_ItemId>1</_ItemId> 
   <_ItemUrl>/spsrollup/projectone/Lists/Project Tasks/DispForm.aspx?ID=1</_ItemUrl> 
   <_ItemEdit>/spsrollup/projectone/Lists/Project Tasks/EditForm.aspx?ID=1</_ItemEdit> 
   <_RowNumber>0</_RowNumber> 
   <Title>Task in Project One</Title> 
   <PercentComplete>0.75</PercentComplete> 
   <Status>In Progress</Status> 
  </Row> 
  ... 
</Rows>

You could also observe some mistakes at the bottom, it will be normal as we haven’t specified anything in the XSLT property.

To convert the resulting XML that we saw up in HTML, we will have to specify the transformation’s code, through an XSLT file Handout. 

Then we will put a simple XSLT to convert data we have obtain in HTML, the code must be entered on the property XSLT.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes" />
  
  <!-- Main Template -->
  <xsl:template match="Rows">
    <table width="100%" 
           class="ms-listviewtable" 
           cellspacing="0" 
           cellpadding="1" 
           border="0" style="border-style: none; width: 100%; border-collapse: collapse;">
      <tbody>
        <xsl:call-template name="DrawHeader" />
        <xsl:for-each select="Row">
          <xsl:call-template name="DrawRow" />
        </xsl:for-each>
      </tbody>
    </table>
  </xsl:template>
  
  <!-- TableRow Template -->
  <xsl:template name="DrawRow">
    <tr>
      <td>
        <xsl:value-of select="_SiteTitle" />
      </td>
      <td>
        <xsl:value-of select="Title" />
      </td>
      <td>
        <xsl:value-of select="PercentComplete*100" />%
      </td>
    </tr>
  </xsl:template>
  
  <!-- TableHeader Template -->
  <xsl:template name="DrawHeader">
    <tr class="ms-viewheadertr" valign="top">
      <th class="ms-vh2-nofilter ms-vh2-gridview" nowrap="">
        Site
      </th>
      <th class="ms-vh2-nofilter ms-vh2-gridview" nowrap="">
        Title
      </th>
      <th class="ms-vh2-nofilter ms-vh2-gridview" nowrap="">
        Completed
      </th>
    </tr>
  </xsl:template>
</xsl:stylesheet>

Getting the following results: