The SAS Output Delivery System and reporting techniques

Page numbers in ODS HTML

Occasional Contributor
Posts: 14

Page numbers in ODS HTML

I have been asked to output a table in both RTF and HTML.  I have a macro that adds "Page x of y" to the title in the RTF output, but have been unsuccessful in finding anything that will work in HTML. Is there a way to directly convert the RTF file (with the correct page numbers) into an HTML document?

Super User
Super User
Posts: 9,427

Re: Page numbers in ODS HTML

Well, HTML does not have pages as such from my recollection.  I would go back and check what the requirement for HTML is, I wouldn't expect reviewers want to see a HTML document, least I have never heard of it.

One option, maybe use Word to open the RTF and then save to HTML.  Thing is HTML is just one long page so it may look odd having page numberings half way down the page - dependant on the renderer used to view.

Posts: 9,325

Re: Page numbers in ODS HTML


  You are correct. Any page numbers that are put on an HTML document happen in the printing interface between the browser and the printer.  By then, SAS is out of the picture. The HTML specification by the W3C does not have page numbering in the specification for the HTML tags. There may be something in the CSS specification about paged media, but I believe that HTML displayed on the screen is considered continuous media, not paged media. You can look at the W3C CSS spec here

  Generally the only ODS destinations that support "Page X of Y" page numbering are RTF and PDF -- and you don't necessarily need a macro for them, you can just use ODS ESCAPECHAR functions {thispage} and {lastpage} with the current ESCAPECHAR.


Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation