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.
GreggB
Pyrite | Level 9

I want to change the left and right margins in the pdf files I am outputting.  Actually, the real problem is that each obs requires more than one line, so I thought I would start with the orientation and margin width.  I would welcome suggestions for any other options that would allow me to output one record per line.

partial code:

%macro elemREP (num=);

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

proc print data=joinelem4 noobs

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

HI:

  I have a few suggestions. One is to flip your statements and list the margin options BEFORE the ODS PDF statement. This will ensure that ODS will get the NEW options when it starts up. The other option is to specify an exact unit of measure with ODS PDF -- otherwise, you are forcing PDF to translate from the default unit of measure.

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

  For example, consider the difference in output length and width for just 30 obs in SASHELP.CARS.

cynthia

options orientation=landscape nodate pageno=1 leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\carss.pdf';

proc report data=sashelp.cars(obs=30) nowd;

title '1) take all defaults';

run;

proc report data=sashelp.cars(obs=30) nowd

  style(report)={cellpadding=2px font_size=8pt}

  style(header)={font_size=9pt}

  style(column)={font_size=8pt};

title '2) change some style options';

run;

ods pdf close;

View solution in original post

3 REPLIES 3
Reeza
Super User

I think you'll need to post some sample data for more help.

Other methods include modifying the template to reduce cell size and padding.

Here's a link to a common style I've used (borrowed from a former colleague). You can modify the cell spacing, padding and font size as needed.

Hope it's helpful.

SAS - RTF Style for tables

Cynthia_sas
SAS Super FREQ

HI:

  I have a few suggestions. One is to flip your statements and list the margin options BEFORE the ODS PDF statement. This will ensure that ODS will get the NEW options when it starts up. The other option is to specify an exact unit of measure with ODS PDF -- otherwise, you are forcing PDF to translate from the default unit of measure.

options orientation=landscape nodate pageno=1 leftmargin=.1 rightmargin=.1;

ods pdf body="G:\Departments\Research\Misc\EVAAS\1415\School Rosters\&num._Verify_Roster_EVAAS.pdf";

  For example, consider the difference in output length and width for just 30 obs in SASHELP.CARS.

cynthia

options orientation=landscape nodate pageno=1 leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\carss.pdf';

proc report data=sashelp.cars(obs=30) nowd;

title '1) take all defaults';

run;

proc report data=sashelp.cars(obs=30) nowd

  style(report)={cellpadding=2px font_size=8pt}

  style(header)={font_size=9pt}

  style(column)={font_size=8pt};

title '2) change some style options';

run;

ods pdf close;

GreggB
Pyrite | Level 9

Thanks for your help.

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
  • 11571 views
  • 0 likes
  • 3 in conversation