Skip Navigation LinksHome Page > Forums > SpiraTeam Forums > Spira Custom Reports > Merging word document to ...
I need to append/merge the cover page in docx format to the exported spira report.
kindly let me know if anyone has tried to achieve the same or has any idea on merging to spira report.
Thanks
Try to write your own custom report where docx is formed by JavaScript. We are preparing complicated office docs that way as xslt is not so flexible as JS.
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:template match="/RESULTS"> <script type="text/javascript"> releases=[]; <xsl:for-each select="ROW"> releases.push({ id:xsltToNumber('<xsl:value-of select='ID'/>'), is_summary:xsltToBoolean('<xsl:value-of select='IS_SUMMARY'/>'), name:xsltToString('<xsl:value-of disable-output-escaping="yes" select='Name'/>'), resource_count:xsltToNumber('<xsl:value-of select='RESOURCE_COUNT'/>'), uihd:xsltToNumber('<xsl:value-of select='UIhd'/>'), apihd:xsltToNumber('<xsl:value-of select='APIhd'/>'), }); </xsl:for-each> <xsl:text disable-output-escaping="yes"> <![CDATA[ console.log('it works'); // any JS code here that works for example with releases array variable that is defined above ]]> </xsl:text> </script> </xsl:template> </xsl:stylesheet>
Here is an example.
First part: we are combining XSLT+JS to fill JS variable.
Second part: we are working with full JS power to get anything we need incl. word document to download.
We are doing basically the same but without the Javascript.
Purely based on XSLT, you can dynamically add the word formatting for almost any feature supported by Word (although stuff like signature boxes takes some extra tweaking to get right)
And if you have any questions, please email or call us at +1 (202) 558-6885