The SAS Output Delivery System and reporting techniques

{pageof} does not show page numbers when used with tagset

Reply
N/A
Posts: 0

{pageof} does not show page numbers when used with tagset

Hello

In #Code below, {pageof} used with ODS Tagset does not show the page numbers when the word document is opened, however it is seen in print out and print previews. How can we see the page numbers when the document is opened. This issue was highlighted by audit.
Note: Need to use ODS Tagset


# Code
============================
ods escapechar='^';
title1 'Table 11-20 (Page ^{pageof})';
ods tagsets.rtf file='c:\test.rtf';
proc print data=sashelp.class noobs label;
run;
ods tagsets.rtf close;

Thank you very much
Sanjay Masawan
SAS Employee
Posts: 20

Re: {pageof} does not show page numbers when used with tagset

Posted in reply to deleted_user
Hello Sanjay,

Titles and footnotes are tables in tagsets.rtf. As such the field edit instructions do not get executed by default on opening the file in edit mode. If you use Print Preview in Word, the instructions should be executed as if you were prinitng the doc.

Another way to get at this without the Print Preview setting is to use the PAGENO style element. This will give you the ability to change the page number setting that is imposed with an rtf "header" specification.

style pageno from pageno /
font = fonts("strongfont")
cellpadding = 0
cellspacing = 0
posttext="of (*ESC*){lastpage} ";
;
end;

then apply the style on the ODS statement.

ods tagsets.rtf file='Pageof.map' style=styles.pageof;
SAS Super FREQ
Posts: 8,866

Re: {pageof} does not show page numbers when used with tagset

Posted in reply to deleted_user
Hi:
The {pageof} ESCAPECHAR function inserts Word field codes into your document. I believe you can toggle with Alt+F9 to reveal the codes. It makes sense to me that you'd see the page numbers only in Print Preview. The status bar in Word tells you what the page numbers are otherwise. I thought that page numbers only appeared in Edit mode when they were in the header/footer area of the document. Since TAGSETS.RTF doesn't put the page numbers in the header/footer area when you use {PAGEOF}, I tested what the default Word behavior will be.

If I go into Word (without using SAS) and start a new document and tell Word to put the page number in the body of the document (Insert --Page Numbers -- Current Position), I do NOT see page numbers until I am in Print Preview mode. What I see in the body of the word document is:
[pre]
{ PAGE \* MERGEFORMAT }
[/pre]

So, it seems to me that this issue is not with SAS, but with how Word treats page numbers inserted into the body of your document.


cynthia
N/A
Posts: 0

Re: {pageof} does not show page numbers when used with tagset

Posted in reply to Cynthia_sas
Hello Cynthia,

How come it works fine with ODS rtf and not with tagset.
Please suggest a way to get this working.

Regards
Sanjay
SAS Super FREQ
Posts: 8,866

Re: {pageof} does not show page numbers when used with tagset

Posted in reply to deleted_user
Hi:
There is nothing to "get working" ODS RTF is working as designed and ODS TAGSETS.RTF is working as designed. ODS RTF is the "original" RTF -- the page numbering instructions, when you use ODS ESCAPECHAR are inserted into the HEADER and FOOTER areas of the document, which then are resolved (by Word) when the document is opened in Edit mode. ODS TAGSETS.RTF works slightly differently, the SAS TITLE and FOOTNOTE are -inside- the document, but not in the HEADER and FOOTER area.

When you create a document with TAGSETS.RTF, the field codes do not show in the body of the document because of Microsoft Word behavior. These field codes are not shown in Edit mode -- that's how Word works.

Your choices are to switch back to ODS RTF so your titles and footnotes go into the header/footer area of the document or to use the style template method already outlined by Wayne in his answer to your question.

cynthia
Ask a Question
Discussion stats
  • 4 replies
  • 371 views
  • 1 like
  • 3 in conversation