Create a report:
This article assumes you are familiar with the basics of writing custom reports in Spira.
In this example we will build a custom report with custom ESQL section.
To create the report you need to:
- Go to Administration > Edit Reports
- Click on Create a new Report (at the bottom of the list of existing Reports)
- Specify that it should allow generation in MS-Word, Excel, HTML and PDF formats
- Choose to add a Custom Section:
SQL Query:
- Choose the Pending Test Runs from predefined queries list
- You'll see the automatic query generated filtering the pending test runs by Product
- Click Preview Results to see the output
- It can be customized so to get the list of pending test runs:
- To see all the pending test runs in the system: delete the filtering WHERE statement so the final query will be
select value R from SpiraTestEntities.R_PendingTestRuns as R
- Getting the name of the Program (product group) the pending test run belongs to:
SELECT PTR.TEST_RUNS_PENDING_ID, PTR.NAME, PTR.CREATION_DATE, PTR.LAST_UPDATE_DATE, PTR.COUNT_PASSED,
PTR.COUNT_FAILED, PTR.COUNT_BLOCKED, PTR.COUNT_CAUTION, PTR.COUNT_NOT_RUN,PTR.COUNT_NOT_APPLICABLE,
PTR.TESTER_LOGIN, PTR.TESTER_FULLNAME, PTR.TEST_SET_NAME, PR.PROJECT_GROUP_NAME
from SpiraTestEntities.R_PendingTestRuns as PTR
INNER JOIN SpiraTestEntities.R_Projects as PR ON PTR.PROJECT_ID = PR.PROJECT_ID
- Click the 'Create Default Template' option to generate the following XSLT report template or use the generated XSLT 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>TEST_RUNS_PENDING_ID</th><th>NAME</th><th>CREATION_DATE</th><th>LAST_UPDATE_DATE</th><th>COUNT_PASSED</th><th>COUNT_FAILED</th><th>COUNT_BLOCKED</th><th>COUNT_CAUTION</th><th>COUNT_NOT_RUN</th><th>COUNT_NOT_APPLICABLE</th><th>TESTER_LOGIN</th><th>TESTER_FULLNAME</th><th>TEST_SET_NAME</th><th>PROJECT_GROUP_NAME</th></tr>
<xsl:for-each select="ROW">
<tr><td><xsl:value-of select="TEST_RUNS_PENDING_ID"/></td><td><xsl:value-of select="NAME"/></td><td><xsl:value-of select="CREATION_DATE"/></td><td><xsl:value-of select="LAST_UPDATE_DATE"/></td><td><xsl:value-of select="COUNT_PASSED"/></td><td><xsl:value-of select="COUNT_FAILED"/></td><td><xsl:value-of select="COUNT_BLOCKED"/></td><td><xsl:value-of select="COUNT_CAUTION"/></td><td><xsl:value-of select="COUNT_NOT_RUN"/></td><td><xsl:value-of select="COUNT_NOT_APPLICABLE"/></td><td><xsl:value-of select="TESTER_LOGIN"/></td><td><xsl:value-of select="TESTER_FULLNAME"/></td><td><xsl:value-of select="TEST_SET_NAME"/></td><td><xsl:value-of select="PROJECT_GROUP_NAME"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Running the report and expected output
As a result of the report execution you should get something like:
Please note that running selected Test Cases without a Test Set listed as 'Various Test Cases' in the column with Name of the Test Set.