The Problem

When we ran the standard requirements detailed report, we got the following output:

This is good when you need all the information for audit purposes, but it was harder for us to put into a single document and review the functionality. So we created a new simplified requirements report that included just the information we needed, and nothing else:

This gave us the key requirements fields and description, and the tasks, incidents and associated requirements in an easy to read bulleted list format instead of the standard tables.

Creating this Report

If you follow the instructions in the documentation for creating a custom report, using a standard section, you will just need to Clone the standard Requirements Detailed Report and change the template for the Requirements Details section to be:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:template match="/RequirementData">
    <xsl:for-each select="Requirement">
      <div>
        <xsl:attribute name="style">
          margin-left: <xsl:value-of select="string-length(IndentLevel)*3"/>px;
        </xsl:attribute>
        <xsl:if test="IsSummary='True'">
          <div class="Title2">
            RQ:<xsl:value-of select="RequirementId"/> - <xsl:value-of select="Name"/>
          </div>
          <div class="Description">
            <xsl:value-of select="Description" disable-output-escaping="yes"/>
          </div>
          <br />
        </xsl:if>
        <xsl:if test="IsSummary='False'">
          <xsl:attribute name="style">
            padding-left: <xsl:value-of select="string-length(IndentLevel)*3"/>px;
          </xsl:attribute>
          <div class="Title3">
            RQ:<xsl:value-of select="RequirementId"/> - <xsl:value-of select="Name"/>
          </div>
          <p>
            <xsl:value-of select="Description" disable-output-escaping="yes"/>
          </p>
        </xsl:if>
        <table class="HiddenTable">
          <tr>
            <th>Type:</th>
            <td>
              <xsl:value-of select="RequirementTypeName"/>
            </td>
            <th>Component:</th>
            <td>
              <xsl:value-of select="ComponentName"/>
            </td>
          </tr>
          <tr>
            <th>Priority:</th>
            <td>
              <xsl:value-of select="ImportanceName"/>
            </td>
            <th>Status:</th>
            <td>
              <xsl:value-of select="RequirementStatusName"/>
            </td>
          </tr>
		</table>
        <xsl:if test="Discussions/Discussion">
          <div class="Title3">
            Comments:
          </div>
          <ul>
            <xsl:for-each select="Discussions/Discussion">
              <li>
			      <b>
                  <xsl:call-template name="format-date">
                    <xsl:with-param name="datetime" select="CreationDate" />
                  </xsl:call-template>
				  -
				  <xsl:value-of select="CreatorName"/>
				  </b>
				  <br />
                  <xsl:value-of select="Text" disable-output-escaping="yes"/>
              </li>
            </xsl:for-each>
          </ul>
        </xsl:if>
        <xsl:if test="Requirements/ArtifactLink">
          <div class="Title4">
            Linked Requirements
          </div>
          <ul>
            <xsl:for-each select="Requirements/ArtifactLink">
              <li>
			    <b>
                  [RQ:<xsl:value-of select="ArtifactId"/>]
				</b>
				-
                <xsl:value-of select="ArtifactName"/>
              </li>
            </xsl:for-each>
          </ul>
        </xsl:if>
        <xsl:if test="Incidents/ArtifactLink">
          <div class="Title4">
            Associated Incidents
          </div>
          <ul>
            <xsl:for-each select="Incidents/ArtifactLink">
              <li>
			    <b>
                  [IN:<xsl:value-of select="ArtifactId"/>]
				</b>
				-
                <xsl:value-of select="ArtifactName"/>
              </li>
            </xsl:for-each>
          </ul>
        </xsl:if>
        <xsl:if test="Tasks/Task">
          <div class="Title4">
            Associated Tasks:
          </div>
          <ul>
            <xsl:for-each select="Tasks/Task">
              <li>
			    <b>
                  [TK:<xsl:value-of select="TaskId"/>]
				  -
                  <xsl:value-of select="Name"/>
				</b>
				<br />
				<xsl:value-of select="Description" disable-output-escaping="yes"/>
              </li>
            </xsl:for-each>
          </ul>
        </xsl:if>
        <br />
      </div>
    </xsl:for-each>
  </xsl:template>
  <xsl:template name="format-date">
    <xsl:param name="datetime"/>
    <xsl:variable name="date" select="substring-before($datetime, 'T')" />
    <xsl:variable name="year" select="substring-before($date, '-')" />
    <xsl:variable name="month" select="substring-before(substring-after($date, '-'), '-')" />
    <xsl:variable name="day" select="substring-after(substring-after($date, '-'), '-')" />
    <xsl:variable name="time" select="substring-before(substring-after($datetime, 'T'), '.')" />
    <xsl:variable name="monthname">
      <xsl:choose>
        <xsl:when test="$month='01'">
          <xsl:value-of select="'Jan'"/>
        </xsl:when>
        <xsl:when test="$month='02'">
          <xsl:value-of select="'Feb'"/>
        </xsl:when>
        <xsl:when test="$month='03'">
          <xsl:value-of select="'Mar'"/>
        </xsl:when>
        <xsl:when test="$month='04'">
          <xsl:value-of select="'Apr'"/>
        </xsl:when>
        <xsl:when test="$month='05'">
          <xsl:value-of select="'May'"/>
        </xsl:when>
        <xsl:when test="$month='06'">
          <xsl:value-of select="'Jun'"/>
        </xsl:when>
        <xsl:when test="$month='07'">
          <xsl:value-of select="'Jul'"/>
        </xsl:when>
        <xsl:when test="$month='08'">
          <xsl:value-of select="'Aug'"/>
        </xsl:when>
        <xsl:when test="$month='09'">
          <xsl:value-of select="'Sep'"/>
        </xsl:when>
        <xsl:when test="$month='10'">
          <xsl:value-of select="'Oct'"/>
        </xsl:when>
        <xsl:when test="$month='11'">
          <xsl:value-of select="'Nov'"/>
        </xsl:when>
        <xsl:when test="$month='12'">
          <xsl:value-of select="'Dec'"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="''" />
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:value-of select="concat($day, '-' ,$monthname, '-', $year , ' ', $time)" />
  </xsl:template>
</xsl:stylesheet>