The SAS Output Delivery System and reporting techniques

ODS PDF TEXT with TITLE and multi-page REPORT table

Reply
Occasional Contributor
Posts: 17

ODS PDF TEXT with TITLE and multi-page REPORT table

Good afternoon,

I am trying to accomplish the following layout in a PDF document:

System title 1
System title 2

ODS PDF TEXT string 1
ODS PDF TEXT string 2
(no space)
Table from PROC REPORT that spans multiple pages
(no space)
ODS PDF TEXT string 3
ODS PDF TEXT string 4

To get the System titles to go before the ODS TEXT string, I applied the technique outlined in http://support.sas.com/resources/papers/proceedings10/035-2010.pdf as well as in this forum, i.e. issue a STARTPAGE=NOW in the ODS PDF statement, and then issue an ODS STARTPAGE=NO before the ODS PDF TEXT statement.

What happens is that I get the system titles, then the ODS TEXT strings, but if the table spans multiple pages, it will start on page 2. You should be able to replicate this in 9.2 using the following code:

DATA FOO;
SET SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS;
RUN;

OPTIONS NODATE NONUMBER;
TITLE "System title 1";
TITLE2 "System title 2";
FOOTNOTE "System footnote 1";
FOOTNOTE2 "System footnote 2";
ODS PDF STYLE=JOURNAL FILE="REPORT.PDF" STARTPAGE=NOW;
ODS PDF STARTPAGE=NO;
ODS PDF TEXT="String 1 to go before table";
ODS PDF TEXT="String 2 to go before table";
PROC REPORT DATA=FOO NOWD SPANROWS STYLE(REPORT)=[WIDTH=100%];
COLUMNS SEX AGE HEIGHT WEIGHT;
DEFINE SEX / GROUP "This is the gender column";
DEFINE AGE / DISPLAY "This is the age column";
DEFINE HEIGHT / DISPLAY "This is the height column";
DEFINE WEIGHT / DISPLAY "This is the weight column";
RUN;
ODS PDF TEXT="String 3 to go after table";
ODS PDF TEXT="String 4 to go after table";
ODS PDF CLOSE;

I'm guessing that the STARTPAGE=NOW which gives us the new page along with the system title might also compute the size of the PROC REPORT table section that should go on the first page before it places the ODS PDF TEXT strings and then, once the strings are put on the page, it realizes that there is not enough space for the first part of the table that should go on page 1 and places it on page 2 (just a guess!).

Is there any workaround or trick that would allow for the desired layout?

Thank you in advance for your help!

Daniel
SAS Super FREQ
Posts: 8,864

Re: ODS PDF TEXT with TITLE and multi-page REPORT table

Hi:
If you are using the technique as described in the paper and it's not working as expected, then you should work with Tech Support. Some workarounds include using OBS= and FIRSTOBS= to control the number of obs that get displayed on page 1 versus the other pages, but, I'd really recommend checking with Tech Support first. They may be aware of this behavior with big tables and know of a different workaround.

cynthia
Occasional Contributor
Posts: 17

Re: ODS PDF TEXT with TITLE and multi-page REPORT table

Posted in reply to Cynthia_sas
Thank you very much Cynthia! I did just that and here is what I got from Technical Support:

This issue is addressed in Problem Note 11535 - http://support.sas.com/kb/11/535.html

The workaround suggested by TS is to add the UNIFORM option in the ODS PDF statement and in this case, it does work!

Daniel
Ask a Question
Discussion stats
  • 2 replies
  • 322 views
  • 0 likes
  • 2 in conversation