The SAS Output Delivery System and reporting techniques

ODS PDF landscape orientation - lot of space on right side of the page and rightmargin= seems not working

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

ODS PDF landscape orientation - lot of space on right side of the page and rightmargin= seems not working


Hi ,

I was trying to print the report with about 20 columns in PDF.

my options  for ods pdf were,

options nocenter  papersize=a4 orientation=landscape rightmargin=0.25cm;

Right margin seems to be not working when the papersize=A4 or letter and I see a lot of space on right sid eof each page.

It seems to be working fine when papersize=a3.

Any help is appreciated.

Thanks,

Dharmendra


Accepted Solutions
Solution
‎07-31-2013 07:27 PM
SAS Super FREQ
Posts: 8,744

Re: ODS PDF landscape orientation - lot of space on right side of the page and rightmargin= seems not working

Hi:

  Without getting into papersize issues, I ran the code below and see that the margins are behaving as I expect. I have posted a picture of the 3rd report, with the left margin set at .25in and the right margin set at .5 in and I don't see a lot of space on the right side of the page. However, when you look at report 1 and 2, you will see relatively more space on the right than the left, which is a function of having NOCENTER turned on. With Report 1a and 2a, you can see the impact of changing OUTPUTWIDTH=100% for the report -- it forces the report to stretch from margin to margin.

  Since I'm not entirely sure what you're seeing and since I don't have A3 or A4 paper to test with, I'd recommend opening a track with Tech Support if you continue to have issues with margins.

cynthia

options  leftmargin=.5in rightmargin=2in orientation=landscape nocenter;
ods listing close;
   
ods pdf file='c:\temp\trymargins1.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type;
  title '1) Nocenter, Left=.5in right=2in default width';
run;

proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type;
  title '1a) Nocenter, Left=.5in right=2in change width 100%';
run;
ods pdf close;  
    
options  leftmargin=1in rightmargin=2in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins2.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2) Nocenter, Left=1in right=2in default width';
run;
  
proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2a) Nocenter, Left=1in right=2in change width 100%';
run;
  
ods pdf close;
     
options  leftmargin=.25in rightmargin=.5in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins3.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders horsepower
         mpg_city mpg_highway weight wheelbase length;
  title '3) Nocenter, Left=.25in right=.5in';
  title2 'With different (wider) data';
run;
ods pdf close;
title;


margin_3_pdf.png

View solution in original post


All Replies
Solution
‎07-31-2013 07:27 PM
SAS Super FREQ
Posts: 8,744

Re: ODS PDF landscape orientation - lot of space on right side of the page and rightmargin= seems not working

Hi:

  Without getting into papersize issues, I ran the code below and see that the margins are behaving as I expect. I have posted a picture of the 3rd report, with the left margin set at .25in and the right margin set at .5 in and I don't see a lot of space on the right side of the page. However, when you look at report 1 and 2, you will see relatively more space on the right than the left, which is a function of having NOCENTER turned on. With Report 1a and 2a, you can see the impact of changing OUTPUTWIDTH=100% for the report -- it forces the report to stretch from margin to margin.

  Since I'm not entirely sure what you're seeing and since I don't have A3 or A4 paper to test with, I'd recommend opening a track with Tech Support if you continue to have issues with margins.

cynthia

options  leftmargin=.5in rightmargin=2in orientation=landscape nocenter;
ods listing close;
   
ods pdf file='c:\temp\trymargins1.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type;
  title '1) Nocenter, Left=.5in right=2in default width';
run;

proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type;
  title '1a) Nocenter, Left=.5in right=2in change width 100%';
run;
ods pdf close;  
    
options  leftmargin=1in rightmargin=2in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins2.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2) Nocenter, Left=1in right=2in default width';
run;
  
proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2a) Nocenter, Left=1in right=2in change width 100%';
run;
  
ods pdf close;
     
options  leftmargin=.25in rightmargin=.5in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins3.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders horsepower
         mpg_city mpg_highway weight wheelbase length;
  title '3) Nocenter, Left=.25in right=.5in';
  title2 'With different (wider) data';
run;
ods pdf close;
title;


margin_3_pdf.png
Occasional Contributor
Posts: 5

Re: ODS PDF landscape orientation - lot of space on right side of the page and rightmargin= seems not working

Thank you so much Cynthia. It worked when tried with the options you mentioned above on one other example dataset, but still I got the same output with lot of space on right side with my data I have until I changed the escapechar from '^' to '~'.

Thanks for your help.

SAS Super FREQ
Posts: 8,744

Re: ODS PDF landscape orientation - lot of space on right side of the page and rightmargin= seems not working

Ah, interesting! Did I miss your earlier posting about ESCAPECHAR? I didn't see that.

cynthia

Occasional Contributor
Posts: 5

Re: ODS PDF landscape orientation - lot of space on right side of the page and rightmargin= seems not working

Cynthia..

I didn't think that was a problem initially with Escapechar until I tried that option. So, I didn't have any post about escapechar.

It was just pure luck that I tried changing the escapechar and it worked out . Very strange, but true.!

-Dharmendra

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 2171 views
  • 0 likes
  • 2 in conversation