Custom Report Builder Question

Friday, September 20, 2013
Avatar

I have the following query:

select REL.Version_Number, REQ.Requirement_ID, REQ.Name as Req_Name, T.Task_ID, T.Name as Task_Name, T.Task_Status_Name
from SpiraTestEntities.R_Releases as REL
left outer join SpiraTestEntities.R_Requirements as REQ on REL.Project_ID = REQ.Project_ID and REL.Release_ID = REQ.Release_ID and REQ.Is_Deleted=false
left outer join SpiraTestEntities.R_Tasks as T on REL.Project_ID = T.Project_ID and REL.Release_ID = T.Release_ID and REQ.Requirement_ID = T.Requirement_ID
where REL.PROJECT_ID = ${ProjectId}
order by REL.Release_ID, T.Task_Status_ID

and I'm trying to build the template for the site to display the data like so:

 


















































Version_NumberRequirement_IDReq_Name Task_ID Task_Name Task_Status_Name
 1.0.0.0     
 1.1.0.0 403 Build Something   
    20 Do Task 1 Completed
    22 Do Task 2 Accepted
    23 Do Task 3 Rejected

Is there an easy way to build a template for this?  The template I currently have is:

<?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>Version_Number</th>
   <th>Requirement_ID</th>
   <th>Req_Name</th>
   <th>Task_ID</th>
   <th>Task_Name</th>
   <th>Task_Status_Name</th>
  </tr>
  <tr>
   <td><xsl:value-of select="Version_Number"/></td>
   <td><xsl:value-of select="Requirement_ID"/></td>
   <td><xsl:value-of select="Req_Name"/></td>
  </tr>
      <xsl:for-each select="ROW/Task_ID">
        <tr>
   <td></td>
   <td></td>
   <td></td>
   <td><xsl:value-of select="Task_ID"/></td>
   <td><xsl:value-of select="Task_Name"/></td>
   <td><xsl:value-of select="Task_Status_Name"/></td>
        </tr>
      </xsl:for-each>
        </table>
    </xsl:template>
</xsl:stylesheet>

 

 


 

 

 

2 Replies
Tuesday, October 8, 2013
Avatar
re: djm61 Friday, September 20, 2013
Anyone have any suggestions?
Wednesday, August 20, 2014
Avatar
re: djm61 Friday, September 20, 2013
Try nested for-each tags?

The first would be for releases, the second would be for release-requirements, and the third would be for release-requirement-tasks.

Something like this (and yes, this pseudo code is definitely not valid/well-formed):

<for-each release>
<tr>
td version number (with col span)
</tr>
<for each requirement>
<tr>
td empty col (with col span as desired to span the rel col(s))
td req id (with col span as desired to span the task col(s))
</tr>
<for each task>
<tr>
td empty col (with col span as desired to span the rel and req col(s))
tds for task cols
</tr>
</for each task>
</for each req>
</for each rel>

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Friday, September 20, 2013
  • Last Reply: Wednesday, August 20, 2014
  • Replies: 2
  • Views: 7594