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.
dtirumalasetti
Fluorite | Level 6


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

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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;


undefined

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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;


undefined
dtirumalasetti
Fluorite | Level 6

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.

Cynthia_sas
SAS Super FREQ

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

cynthia

dtirumalasetti
Fluorite | Level 6

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

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
  • 4 replies
  • 27036 views
  • 3 likes
  • 2 in conversation