The SAS Output Delivery System and reporting techniques

ODS PDF - Shrinking output to fit to one page

Reply
N/A
Posts: 0

ODS PDF - Shrinking output to fit to one page

I'm running a multiple page proc report. The output is approx 30 columns wide and the user needs each page to be printable. I'm using options legal and landscape but am still running out of room. Are there any shrink to fit options in ODS PDF or elsewhere? Thanks.
SAS Super FREQ
Posts: 8,864

Re: ODS PDF - Shrinking output to fit to one page

Posted in reply to deleted_user
Hi!
There are several ways to shrink your output. There is no "shrink to fit" with ODS because ODS leaves it to the viewer/rendering software to control printing issues. There are some SAS options that you can set that specifically affect PDF output. For example these options are one place to start:
[pre]
options orientation=landscape nocenter
topmargin=.25in
bottommargin=.25in
leftmargin=.25in rightmargin=.25in ;
[/pre]
Since you are using Proc Report, you are in luck. You can test different runs of Proc Report to ODS PDF using the STYLE= statement level overrides that are possible with REPORT, PRINT and TABULATE procedures.

You can try several things:
1) reduce all the fonts for headers and data cells (possibly change the font_face to a "narrow" font)
2) reduce cell padding values (cell padding is the "white space" around the text in a cell)
3) reduce of remove the cell spacing (cell spacing is the amount of space "between" each cell") -- a cellspacing=0 specification would essentially be used to suppress spaces between the cells
4) experiment with values for RULES= and FRAME= style attributes
5) experiment with setting explicit cellwidth values (I list this last because this is the most finicky to change, in my opinion)

So, for example to do #1, you would change your proc report to:
[pre]
** use above options statement;
ods pdf file='c:\temp\testfont.pdf';
proc report data=sashelp.class nowd
style(report)={font_size=9pt}
style(header)={font_size=9pt}
style(column)={font_size=8pt};
column name age height;
...
run;
ods pdf close;
[/pre]

Of course, you would use your data where I have sashelp.class listed. Then to reduce cellpadding, you would revisit your proc report statement with the following change/addition to reduce cellpadding from the PDF default of 4pt to 2pt and to change cellspacing from the .25pt default to .15pt:
[pre]
proc report data=sashelp.class nowd
style(report)={font_size=9pt cellpadding=2pt
cellspacing=.15pt}
style(header)={font_size=9pt}
style(column)={font_size=8pt};
... sas code ...
[/pre]

To remove ALL interior table lines, and exterior box and possibly gain back some space, you can try this:

[pre]
proc report data=sashelp.class nowd
style(report)={font_size=9pt cellpadding=2pt
cellspacing=0 rules=none
frame=void}
style(header)={font_size=9pt}
style(column)={font_size=8pt};
... sas code ...
[/pre]

I find that reducing margins, font_size and cellpadding generally get my reports to fit when they are very wide. Earlier in the forum, I posted an example macro program that demo'd how font changes could make a very wide report fit in landscape orientation. If you search this forum for a posting entitled, "Dealing with very wide tables", you can copy the macro program from there.
I hope this helps you with your report.
cynthia
Contributor
Posts: 66

Re: ODS PDF - Shrinking output to fit to one page

Posted in reply to Cynthia_sas

Hi Cynthia,

I have 62 columns in my report and about 40 rows. I want my report in 3 pages.( 16 columns in 1st page  and 23 each on 2nd and 3rd) is there a way I can control this?

I prefer pdf out put as it preserves SAS formatting.

Thanks,

Raghu.

SAS Super FREQ
Posts: 8,864

Re: ODS PDF - Shrinking output to fit to one page


Hi:

  I almost didn't see this, because it was piggybacked in the middle of a post that was answered several years ago.

  I guess I don't quite understand what you want. My tendency would be to do 3 separate proc reports or proc prints, especially if you make it so that each of your 40 obs fits on 1 page:

1 for page 1, list columns 1-16

1 for page 2, list columns 17-39

1 for page 3, list columns 40-62

  But, even so, I think that 40 obs will not fit on either a landscape or a portrait page unless you shrink the font size and cellpadding and change the font used, as described in the post above. Have you tried any of the suggestions above or looked at the code that was posted under the topic of dealing with very wide tables?

cynthia

N/A
Posts: 0

Re: ODS PDF - Shrinking output to fit to one page

Posted in reply to deleted_user
Thanks. I used your advice in "Dealing with very wide tables" and it worked, although the end user will have to use a magnifying glass to read the table. Oh well, price they'll have to pay to have everything on one page.
Regular Contributor
Regular Contributor
Posts: 156

Re: ODS PDF - Shrinking output to fit to one page

Posted in reply to deleted_user
Hello!

One way to do this is to set

options orientation=landscape papersize=a3;

This increases the possibilty to have the output on one page or at least to shrink the width to one page.

Best regards,
Eva
Ask a Question
Discussion stats
  • 5 replies
  • 13935 views
  • 1 like
  • 4 in conversation