Formatting Custom Reports

Friday, October 28, 2016 3:09:42 PM
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 3:10:40 PM
Avatar
re: inflectra.adam on Friday, October 28, 2016 3:09:42 PM
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

Statistics
  • Started: Friday, October 28, 2016 3:09:42 PM
  • Last Reply: Friday, October 28, 2016 3:10:40 PM
  • Replies: 1
  • Views: 903