ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

I'm writing several tables to a PDF file and trying to get several on one page.

When I use the startpage=never or no options the titles don't get printed anymore in the document.

So a workaround is using ODS PDF Text= instead.

Is there a way to either

1. get the titles working in the output

2. Style the ODS PDF Text (ie Center, enlarge, add padding).

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  As far as Printer Family destinations, like PDF, a SAS title goes at the TOP of the page. When you turn off the page break command between procedures (such as when you use STARTPAGE=), then the second procedure (or subsequent procedures) does/do NOT have a top of page. So you must use ODS TEXT to insert text that you want, in place of a title.

  There are a couple of different ways to style the ODS TEXT string. One is with ODS ESCAPECHAR and the other is with a custom style template and both methods are illustrated in this note:

8044 - The TEXT= option in the ODS PRINTER/RTF statement is always left justified

cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  As far as Printer Family destinations, like PDF, a SAS title goes at the TOP of the page. When you turn off the page break command between procedures (such as when you use STARTPAGE=), then the second procedure (or subsequent procedures) does/do NOT have a top of page. So you must use ODS TEXT to insert text that you want, in place of a title.

  There are a couple of different ways to style the ODS TEXT string. One is with ODS ESCAPECHAR and the other is with a custom style template and both methods are illustrated in this note:

8044 - The TEXT= option in the ODS PRINTER/RTF statement is always left justified

cynthia

Reeza
Super User

Thanks Cynthia.

Is there a way to specify a header and footer in a PDF file across all pages? I have multiple tables going to the same page and sometimes they spill over to 2 or 3 pages, but I need the same header or footer on each page. 

Cynthia_sas
SAS Super FREQ

Hi:

When I run the code below, using SAS 9.3, the SAS TITLE and FOOTNOTE statements specified at the beginning will repeat on all the pages of the output. However, I would expect that if you put different TITLE statements between your procedure steps you will get variable results with STARTPAGE=NO. But in the simplest usage, I do have the same title and footnote repeating across all pages.

cynthia

ods _all_ close;

 

ods pdf file='c:\temp\testtitle.pdf'

    startpage=no;

 

title 'Main Title';

footnote 'Main Footnote';

proc print data=sashelp.class;

run;

ods text= 'something1';

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

ods text= 'something2';

proc print data=sashelp.shoes(obs=50);

run;

ods text='something3';

 

ods pdf close;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 12272 views
  • 1 like
  • 2 in conversation