Creating the Custom Report

This article assumes you are familiar with the basics of writing custom reports in Spira. In this example we will be using a custom report with a custom SQL section. To create the report you need to:

  1. Go to Administration  > Edit Reports
  2. Create a new Report
  3. Specify that it should allow generation in MS-Word, Excel, HTML and PDF formats
  4. Choose to add a Custom Section:



    and then paste in the information below:


     
  5. Then click [Save] twice and you can run your report.

The following report definitions should be used:

Query

select RQ.PROJECT_NAME, RTC.REQUIREMENT_ID, RTC.REQUIREMENT_NAME, RQ.RELEASE_VERSION_NUMBER, RTC.TEST_CASE_ID, RTC.TEST_CASE_NAME
from SpiraTestEntities.R_RequirementTestCases as RTC
inner join SpiraTestEntities.R_Requirements as RQ on RTC.REQUIREMENT_ID = RQ.REQUIREMENT_ID
where RQ.PROJECT_GROUP_ID = ${ProjectGroupId} and RQ.IS_DELETED = False
order by RQ.PROJECT_NAME, RQ.INDENT_LEVEL

Template

<?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="/RESULTS">
    <table class="DataGrid">
	  <tr>
	    <th>Project Name</th>
		<th>Requirement #</th>
		<th>Requirement Name</th>
		<th>Release</th>
		<th>Test Case #</th>
		<th>Test Case Name</th>
	  </tr>
      <xsl:for-each select="ROW">
        <tr>
		<td><xsl:value-of select="PROJECT_NAME"/></td>
		<td>RQ<xsl:value-of select="REQUIREMENT_ID"/></td>
		<td><xsl:value-of select="REQUIREMENT_NAME"/></td>
		<td><xsl:value-of select="RELEASE_VERSION_NUMBER"/></td>
		<td>TC<xsl:value-of select="TEST_CASE_ID"/></td>
		<td><xsl:value-of select="TEST_CASE_NAME"/></td>
        </tr>
      </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>

once that is done, you are ready to run your report.

Running the Custom Report

To run the report and generate a program-level RTM, go to the main Reports screen and execute your report:

Now when you run the report (for example in PDF format) you will see this:

A copy of the complete PDF report is attached to this article.

You can run the same report in other formats as well (HTML, MS-Word and MS-Excel).