Formatting Custom Reports

Friday, October 28, 2016
Avatar
A customer asked this question:

"How do I add line breaks between items in a report? I am using the XSLT template to modify the requirements traceability report and I want to have spaces and newlines instead of commas separating the items"?

1 Replies
Friday, October 28, 2016
Avatar
re: inflectra.david Friday, October 28, 2016
The customer found the answer to their question:

As info, to help others in the future, the only way I found to add spaces between fields in the same table cell was to use "<xsl:text disable-output-escaping="yes"> <![CDATA[&nbsp;]]> <![CDATA[&nbsp;]]></xsl:text>", where <![CDATA[&nbsp;]]> is equal to 1 space.


The following is the code added to display additional details (Status, Owner, Name) about the Incident in the same column with a break between each incident and spaces between each element of the incident. The bold and italics were just for my formatting preference.

          <td>
            <xsl:for-each select="Incidents/Incident">
              <xsl:if test="position() > 1">,</xsl:if>
<br>

<b>
              IN<xsl:value-of select="IncidentId"/>
</b>

<b>
<xsl:text disable-output-escaping="yes"> <![CDATA[&nbsp;]]> <![CDATA[&nbsp;]]></xsl:text> 
  <xsl:value-of select="IncidentStatusName"/>
</b>

<i> 
<xsl:text disable-output-escaping="yes"> <![CDATA[&nbsp;]]> <![CDATA[&nbsp;]]></xsl:text> 
<xsl:value-of select="OwnerName"/>
</i>

<xsl:text disable-output-escaping="yes"> <![CDATA[&nbsp;]]> <![CDATA[&nbsp;]]></xsl:text> 
<xsl:value-of select="Name"/>
</br>
            </xsl:for-each>
          </td>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>
</xsl:stylesheet>

Thanks,

Tammy

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, October 28, 2016
  • Last Reply: Friday, October 28, 2016
  • Replies: 1
  • Views: 7965