Hi,
I am using tagsets.rtf to avoid last blank page from ods rtf output. However, if I understand correctly, tagsets.rtf will read one page volume of data once and create one page, so what I get from tagsets.rtf doesn't has last blank page but it has all page with page number "Page 1of 1", which is not acceptable for me either...
here is the template I am using:
proc template; define style Template1 / store = SASUSER.TEMPLAT; parent = styles.rtf; style pageno from pageno / font=fonts("strongfont") posttext=" of ^{lastpage} "; style fonts / .................................. end; run;
and I am calling this template here:
ods tagsets.RTF file="&mypath\test.rtf" style=Template1 options(continue_tag="no");
Can anyone please help me here? I would like to avoid last blank page and get correct page number "page 1 of n", many thanks in advance!
Do you need this part?
inserts the current page number.
Tips | This function can be used only with the PRINTER, RTF, and TAGSETS.RTF destinations. |
You must use Print Preview to view the resolved THISPAGE function output that is generated by the TAGSETS.RTF destination. | |
Example | Customizing Titles and Page Numbers |
Hi @data_null__ ,
Thank you for your reply! I tried this full code and get empty number there:
data example;
set sashelp.class;
do i=1 to 5;
output;
end;
run;
ods escapechar='^';
ods tagsets.rtf file="&outdir.\myrtf.rtf" uniform;
proc report nowd data=example;
col i name age sex height weight;
define i / order;
compute after _page_;
line ' compute after Page ^{thispage} of ^{lastpage} or ^{pageof}';
endcomp;
footnote 'footnote Page ^{thispage} of ^{lastpage} or ^{pageof}';
run;
ods tagsets.rtf close;
Here is the output:
Hi @Ksharp
thank you for your help, I tried this, but doesn't work
ods tagsets.RTF file="&testdir.\&test..rtf" style=&style. options(continue_tag="no" VSPACE='no');
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.