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">
          Images:
        </div>
        <xsl:for-each select="Attachments/Attachment">
          <img style="border: 1px solid gray">
            <xsl:attribute name="src">
              ../../Attachment/<xsl:value-of select="AttachmentId"/>.aspx
            </xsl:attribute>
          </img>
        </xsl:for-each>
      </xsl:if>

This article was written for SpiraTeam v4.2. It applies only to HTML format. 

Article Info
  • Last Updated: 11/3/2015
  • Article ID: KB90
  • Views: 1239