- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
This is my first post in the group. Please excuse if any mistake.
We have a macro which generates table output(multiple pages). Is there any way can we get a default header and footer on all pages please.. inODS? Come to know we can create a word file manually with header and footer and by using header option in ODS header="path of the file \filename.docx".
For Ex: ods rtf file="&tabout." header="C:\Temp work\header.docx" ;
its throwing me error:
! header="C:\Temp work\header.docx" ;
------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If by "header" and "footer" you mean the RTF header and footer locations then you may want TITLE, for header, and FOOTNOTE, for footer, location text.
That would look like (dummy code partially as we have no idea what your output generator looks like):
ods rtf file="&tabout." Title1 "C:\Temp work\header.docx"; Footnote1 "This goes in the footer"; Proc print data=sashelp.class; run; ods rtf close;
title; footnote;
ODS destinations like RTF and PDF have additional options that affect how title and footnotes may be placed in a document.
SAS allows up to 10 Title and Footnote statements. These stay in effect until cancelled or replaced. This allows you to have an example, like the document name as title1 placed on each page and then using title2 (and/or 3,4, etc) to provide additional information such as subject or project details for only part of the output.
You cancel a title or footnote by using a statement without any text. So if you have 5 currently defined title statements and issue
title3;
in your code then from that point, until they are redefined, titles 3, 4 and 5 have been cleared.
Note that my example clears all the title and footnote definitions after the document is written. Title is equivalent to Title1 and Footnote to Footnote1 for that purpose.
There are options that control appearance of title text and your ods style in effect for the document will set some things like font, font size, font weight (bold/normal) or style such as italic. You can override such if needed.
I suggest not naming files with a DOCX extension that are actually RTF. Microsoft is getting picky about such false names not matching content. You may be better off with an RTF extension, which will open in word processors by default. If needed do a File Save As to Docx. Or try the ODS WORD destination though that is still pre-production (means may have issues).