For years I have been looking for an easy way to export easily. Well there is a new feature in MS Project
You need to install the Microsoft Project 2002 COM Add-in: XML Reporting Wizard
Then you need to tweak the Extensible Stylesheet Language (XSL) file that the addin uses to format the output. The original ones are hidden away in the folder C:\Program Files\Microsoft Office\Templates\1033\. Note that the ones supplied are not rigorously correct, using upper case tags which don’t validate properly. I made the following file and changed the operators to choose rather than if. Possibly it can be optimized a bit.
<?xml version=’1.0′?> <xsl:stylesheet xmlns:xsl=”http://www.w3.org/TR/WD-xsl”> <xsl:template match=”/”> <html> <body bgcolor=”white”> <table border=”0″ cellspacing=”1″> <tr> <td colspan=”5″ align=”center”> <h2><font face=”tahoma” size=”5″>Tasks for Project: <xsl:value-of select=”Project/Name” /> </font></h2> </td> </tr> <tr bgcolor=”0×333FF”> <th><font color=”white”>ID</font></th> <th><font color=”white”>WBS</font></th> <th><font color=”white”>Name</font></th> <th><font color=”white”>Start</font></th> <th><font color=”white”>Finish</font></th> <th><font color=”white”>Duration</font></th> <th><font color=”white”>Predecessor</font></th> <th><font color=”white”>ResourceName</font></th> <th><font color=”white”>PercentComplete</font></th> </tr> <xsl:for-each select=”Project/Tasks/Task”> <xsl:choose> <xsl:when test=”Summary[.=1]“> <tr> <td><h3><xsl:value-of select=”ID”/></h3></td> <td><h3><xsl:value-of select=”WBS”/></h3></td> <td><h3><xsl:value-of select=”Name”/></h3></td> <td><h3><xsl:value-of select=”Start”/></h3></td> <td><h3><xsl:value-of select=”Finish”/></h3></td> <td><h3><xsl:value-of select=”Duration”/></h3></td> <td><h3><xsl:value-of select=”Predecessor”/></h3></td> <td><h3><xsl:value-of select=”ResourceName”/></h3></td> <td><h3><xsl:value-of select=”PercentComplete”/></h3></td> </tr> </xsl:when> <xsl:when test=”Critical[.=1]“> <tr> <td><font color=”red”><xsl:value-of select=”ID”/></font></td> <td><font color=”red”><xsl:value-of select=”WBS”/></font></td> <td><font color=”red”><xsl:value-of select=”Name”/></font></td> <td><font color=”red”><xsl:value-of select=”Start”/></font></td> <td><font color=”red”><xsl:value-of select=”Finish”/></font></td> <td><font color=”red”><xsl:value-of select=”Duration”/></font></td> <td><font color=”red”><xsl:value-of select=”Predecessor”/></font></td> <td><font color=”red”><xsl:value-of select=”ResourceName”/></font></td> <td><font color=”red”><xsl:value-of select=”PercentComplete”/></font></td> </tr> </xsl:when> <xsl:otherwise> <tr> <td><xsl:value-of select=”ID”/></td> <td><xsl:value-of select=”WBS”/></td> <td><xsl:value-of select=”Name”/></td> <td><xsl:value-of select=”Start”/></td> <td><xsl:value-of select=”Finish”/></td> <td><xsl:value-of select=”Duration”/></td> <td><xsl:value-of select=”Predecessor”/></td> <td><xsl:value-of select=”ResourceName”/></td> <td><xsl:value-of select=”PercentComplete”/></td> </tr> </xsl:otherwise> </xsl:choose> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
Formatted with c# code formatter
For more on putting code into posts see this page
