The SAS Output Delivery System and reporting techniques

ODS PDF: dynamic column width

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

ODS PDF: dynamic column width

I am trying to replicate the functionality present in ods RTF for ODS PDF, where if style with width=100% is specified in proc template or in proc report statement, the columns spread to occupy 100% of space, without any gaps between the columns. 

 

I am unable to get the same functionality for pdf. E.g. for a landscape page, I am specifying 2 columns with widths 1 inch each along with width=100% in proc report statement. This creates big gap between two columns and after the end of last column.  

 

Can these gaps between the columns and after the last column be eliminated such that the columns widths automatically spreadout for ODF pdf. I am using SAS 9.3

 

Thanks.

 

Vineet


Accepted Solutions
Solution
‎05-18-2017 03:52 PM
SAS Super FREQ
Posts: 8,718

Re: ODS PDF: dynamic column width

[ Edited ]

Hi:
I find it difficult in ODS PDF to "overcontrol" the widths. PDF will sometimes do what you want, but not always. My recommendation is to use WIDTH=100% and then NOT control the individual columns OR to control the individual columns, but not the width of the whole report. One or the other technique works best for me, but not both.

cynthia

 

Also, ODS PDF has the UNIFORM option, so that will cost you some overhead in pre-processing, but on a multipage report should serve to make the columns uniform across all pages without even fiddling with width.

 

For example, this works quite nicely for me without overcontrolling the individual column widths.

cynthia

options orientation=landscape topmargin=.25in bottommargin=.25in
        leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\test_uniform_with_width.pdf' notoc uniform;
title;
proc report data=sashelp.cars 
     style(report)={width=100%};
  column make model type origin cylinders enginesize msrp invoice;
run;
ods pdf close;

View solution in original post


All Replies
Solution
‎05-18-2017 03:52 PM
SAS Super FREQ
Posts: 8,718

Re: ODS PDF: dynamic column width

[ Edited ]

Hi:
I find it difficult in ODS PDF to "overcontrol" the widths. PDF will sometimes do what you want, but not always. My recommendation is to use WIDTH=100% and then NOT control the individual columns OR to control the individual columns, but not the width of the whole report. One or the other technique works best for me, but not both.

cynthia

 

Also, ODS PDF has the UNIFORM option, so that will cost you some overhead in pre-processing, but on a multipage report should serve to make the columns uniform across all pages without even fiddling with width.

 

For example, this works quite nicely for me without overcontrolling the individual column widths.

cynthia

options orientation=landscape topmargin=.25in bottommargin=.25in
        leftmargin=.25in rightmargin=.25in;

ods pdf file='c:\temp\test_uniform_with_width.pdf' notoc uniform;
title;
proc report data=sashelp.cars 
     style(report)={width=100%};
  column make model type origin cylinders enginesize msrp invoice;
run;
ods pdf close;
Occasional Contributor
Posts: 17

Re: ODS PDF: dynamic column width

Thanks Cynthia, for quick reply. I wish ODS pdf & RTF were designed such that these options worked interchangeably in same way. 

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 117 views
  • 0 likes
  • 2 in conversation