This article describes how you create / modify the XSLT report templates in Spira to include embedded images without having to manually embed them in the artifacts. It uses the ability of the XSLT reports to have an <IMG> tag in the report template that references the attachment URL.

What you need to do is the following:

  1. Locate the report in Administration > System > Edit Reports that you want to add images to.
  2. Click 'Copy' to make a copy of this report. Give the copy a new name.
  3. Click on 'Edit' for the section of this report that you want to add
  4. If this is a Summary Report, make sure you change the 'Standard Section" from the "[Artifact] List" section to the "[Artifact] Details" section as only the detailed sections will include the attachment list.
  5. Inside the XSLT definition, for each item in the report, add the following XSLT template snippit:
      <xsl:if test="Attachments/Attachment">
        <div class="Title3">
        <xsl:for-each select="Attachments/Attachment">
          <img style="border: 1px solid gray">
            <xsl:attribute name="src">
              ../../Attachment/<xsl:value-of select="AttachmentId"/>.aspx

This approach works with SpiraTeam v4.0 or later and works with the HTML, MS-Word 2003, and PDF format reports.

Article Info
  • Last Updated: 7/17/2017
  • Article ID: KB90
  • Views: 2549