displaying actual attachment in report instead of name

Monday, October 21, 2013 7:15:21 PM
hi,

in a test run detailed report, (output to html or word) I want to display the attachments (typically png files) instead of giving the default details.
googling a bit I came up with:
<img src="http://myservername/SpiraTeam/14/Attachment/{AttachmentId}.aspx"/>
this displays the the file correctly, but only in project 14, because project_id is not available in attachment.

I did not find a solution to make the project id variable.
can you provide a working xslt solution for this?
or is there another quicker/better solution?

thx,
Filip
5 Replies
Tuesday, October 22, 2013 5:47:26 PM
Avatar
re: FilipBaert on Monday, October 21, 2013 7:15:21 PM

Hi Filip

Please try the following:

<img>
     <xsl:attribute name="src">
            http://myservername/SpiraTeam/<xsl:value-of select="../../PROJECT_ID" />/Attachment/<xsl:value-of select="AttachmentId" />.aspx
     </xsl:attribute>
</img>

This should work because although the Attachments don't include the project-id, the test runs themselves do.

Regards

Adam

Tuesday, October 22, 2013 5:53:54 PM
Avatar
re: inflectra.adam on Tuesday, October 22, 2013
Adam,

seems to work like a charm.
thanks for the solution!

regards,
Filip
Thursday, July 30, 2015 11:29:01 AM
Avatar
re: FilipBaert on Tuesday, October 22, 2013
Hi,

I don't know if it worked back than when exporting to Word, but now it doesn't.
Word states that it cannot load the png file. This may be explained by the fact that one needs to log in to spirateam to see these images.

what is the solution to see these in a generated word report?

thanks
Filip
Wednesday, August 5, 2015 3:25:22 PM
Avatar
re: FilipBaert on Thursday, July 30, 2015
Hi Filip,

Unfortunately, with SpiraTest 4.1 and later, the embedded images do not display in Word reports. The workaround is to use a different output format.

Regards,
Elise
Friday, November 25, 2016 5:32:14 AM
Avatar
re: inflectra.elise on Wednesday, August 5, 2015

Hi Elise,

How about if the attachment is of Word format? Would it also be uploaded and embedded as part of say PDF format of Test Set Detailed report?

Thanks

Statistics
  • Started: Monday, October 21, 2013 7:15:21 PM
  • Last Reply: Friday, November 25, 2016 5:32:14 AM
  • Replies: 5
  • Views: 918