matlab report generator page number

330 Views Asked by At

I was trying to insert "Page x of y" in the report from report generator in Matlab. The page footer content does not have any options as such. How can I modify it in the custom section.

I was working in the report explorer.

1

There are 1 best solutions below

1
On BEST ANSWER

As far as I know, page headers and footers can only be created for DOCX or PDF formatted reports.

Actually, I would write hundreds of line speaking about how to build up headers and footers in your report documents... but I think that reading this link for you will be more than enough to understand how to build them up.

A little excerpt:

This code defines a document part template Chapter that uses two page footers: one for odd pages and one for even pages. The page number format is Arabic numerals.

<dptemplate name="Chapter">
     <layout style="page-margin: 1in 1in 1in 1in 0.5in 0.5in 0in; 
                        page-size: 8.5in 11in portrait">
         <pfooter type="default" template-name="MyPageFooter"/>
             <pfooter type="even" template-name="MyEvenFooter"/>
         <pnumber format="1" />
      </layout>
<!-- Define  content for your chapter here--fixed text and holes as needed -->
</dptemplate>

These document part templates define the page footers.

<dptemplate name="MyPageFooter">
    <p style="text-align:right;font-family:Arial,Helvetica,sans-serif;font-size:10pt">
    <page/></p>
</dptemplate>
<dptemplate name="MyEvenFooter">
    <p style="text-align:left;font-family:Arial,Helvetica,sans-serif;font-size:10pt">
    <page/></p>
</dptemplate>

The DOM API elements you are looking for are:

  • page for current page number
  • numpages the total number of pages in the document