MATLAB: How to add current date and time to a footer in the report in the MATLAB Report Generator

MATLAB Report Generator

I would like to add the current date and time to a footer in my report.

Best Answer

The ability to add current date and time to a footer in the report is not available in MATLAB Report Generator.
To work around this issue, modify the stylesheet by adding XSL code to it.
1. Create new or modify an existing stylesheet
2. Add Footer Content
3. Expand and click on "Single sided - Center"
<fo:block xmlns:date="<http://exslt.org/dates-and-times http://exslt.org/dates-and-times">>
<xsl:variable name="now" select="date:date-time()"/>
<xsl:text>Generated at </xsl:text>
<xsl:value-of select="date:day-in-month($now)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:month-name($now)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:year($now)"/>
<xsl:text> </xsl:text>
<xsl:value-of select="date:hour-in-day($now)"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="date:minute-in-hour($now)"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="date:second-in-minute($now)"/>
</fo:block>
Note: When you reopen the stylesheet, the line
<fo:block xmlns:date="<http://exslt.org/dates-and-times http://exslt.org/dates-and-times">>
may become
<fo:block>