- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm creating a table using ods pdf and proc report and am having an issue with the text wrapping. For most of the table, the text is wrapped correctly, however occasionally longer words will fail to break properly. So, for example "STOMATOLOGICAL PREPARATIONS", the "S" at the end is crossing the border into the next column. What can I do to prevent this? Thanks!
proc report data=mydata list nowd headline headskip missing split='#' spacing=1 wrap nocenter
style(header)={backgroundcolor=cxE0E0E0};
column dummyvar name atcclass indc route date medreas;
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name" style(header)={width=2.0in font_weight=bold textalign=left} left;
define atcclass / display "ATC Classification" style(header)={width=1.9in font_weight=bold textalign=left} left;
define indc / display "Indication" style(header)={width=1.5in font_weight=bold textalign=left} left;
define route / display "Route" style(header)={width=1.0in font_weight=bold textalign=left} left;
define date / display "Start Date(Day)/#End Date(Day)" style(header)={width=1.0in font_weight=bold textalign=left} left;
define medreas / display "Reason for Medication" style(header)={width=1.5in font_weight=bold textalign=left} left;
break before dummyvar / page contents="";
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I changed a few things in your code -- I got rid of REPLACE in the style template, which is was deprecated between 9.1 and 9.2 (see this paper by Kevin Smith: http://www2.sas.com/proceedings/sugi31/053-31.pdf on page 1-- the section that starts "Replace is Dead").
Here is the output I got by using your style and making different changes for width, cellpadding and font:
There is a visible difference to cellpadding between #2 and #3 and 4.
Here's the code I used:
ods path work.tt(update) sasuser.templat(update) sashelp.tmplmst(read);
proc template;
define style mypdfstyle;
parent = styles.printer;
style fonts from fonts/
'headingFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'docFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'footFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'TitleFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'TitleFont2' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 10pt, Bold)
'StrongFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'EmphasisFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedEmphasisFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedStrongFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedHeadingFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'BatchFixedFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'headingEmphasisFont'= ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
;
style GraphFonts from GraphFonts /
'headingFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'docFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'footFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'TitleFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 10pt, Bold)
'GraphDataFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 6pt)
'GraphUnicodeFont' = ("<MTserif-unicode> ", 8pt)
'GraphValueFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 7pt)
'GraphLabelFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'GraphFootnoteFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'GraphTitleFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 10pt, Bold)
'GraphAnnoFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 7pt)
;
class Body from Document /
bottommargin = 0.75in
topmargin = 1in
rightmargin =1in
leftmargin = 1in
;
style usertext from usertext /
font_size=8pt
font_weight=bold
;
class Table from Output /
frame = BOX
rules = ALL
;
style SystemTitle from SystemTitle "Controls system title text." /
protectspecialchars=off
foreground = black
background = white
;
style SystemFooter from SystemFooter "Controls system footer text." /
just=left
protectspecialchars=off
font = Fonts('FootFont')
;
class color_list /
'link' = blue
'bgh' = white
'fg' = black
'bg' = white
;
end;
run;
data conmed;
length name atcclass route indc $200
date $40
medreas $100;
infile datalines DLM=",";
input dummyvar name $ atcclass $ indc $ route $ date $ medreas $;
datalines;
1,Drug 1/~nDrug 2,ATC CLASSIFICATION 1,Indication 1,Route 1,2099-99-99/~n2099-99-99,Reason 1
1,Drug 1/~nDrug 2,STOMATOLOGICAL PREPARATIONS,Indication 2,Route 2,2099-99-99/~n2099-99-99,Reason 2
1,Drug 1/~nDrug 2,ANTIBACTERIALS FOR SYSTEMIC USE,Indication 2,Route 2,2099-99-99/~n2099-99-99,Reason 2
;
run;
%let s_title=background=white font_weight=bold just=L borderleftcolor=white borderrightcolor=white bordertopcolor=white;
ods escapechar="~";
ods html close;
ods listing close;
options orientation=landscape center date number
topmargin=1in bottommargin=.75in leftmargin=1in rightmargin=1in;
ods pdf file="c:\temp\testfile_width_report.pdf" style=mypdfstye ;
title '1) using simple width=100%';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(header)={backgroundcolor=cxE0E0E0}
style(report)={width=100%};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ font_weight=bold textalign=left} ;
define atcclass / display "ATC Classification"
style(header)={ font_weight=bold textalign=left} ;
define indc / display "Indication"
style(header)={ font_weight=bold textalign=left} ;
define route / display "Route"
style(header)={ font_weight=bold textalign=left} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ font_weight=bold textalign=left} ;
define medreas / display "Reason for Medication"
style(header)={ font_weight=bold textalign=left} ;
break before dummyvar / page contents="";
run;
title '2) using widths ONLY for ATCCLASS';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(header)={backgroundcolor=cxE0E0E0};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ font_weight=bold textalign=left} ;
define atcclass / display "ATC Classification"
style(header)={ width=2.25in font_weight=bold textalign=left} ;
define indc / display "Indication"
style(header)={ font_weight=bold textalign=left} ;
define route / display "Route"
style(header)={ font_weight=bold textalign=left} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ font_weight=bold textalign=left} ;
define medreas / display "Reason for Medication"
style(header)={ font_weight=bold textalign=left} ;
break before dummyvar / page contents="";
run;
title '3) using cellpadding and widths for all';
title2 'There is a visible difference between 1, 2 and 3';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(report)={cellpadding=3px}
style(header)={backgroundcolor=cxE0E0E0};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ width=1.0in font_weight=bold textalign=left} ;
define atcclass / display "ATC Classification"
style(header)={ width=2.25in font_weight=bold textalign=left} ;
define indc / display "Indication"
style(header)={ width=1.25in font_weight=bold textalign=left} ;
define route / display "Route"
style(header)={width=1.25in font_weight=bold textalign=left} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ width=1.0in font_weight=bold textalign=left} ;
define medreas / display "Reason for Medication"
style(header)={ width=1.5in font_weight=bold textalign=left} ;
break before dummyvar / page contents="";
run;
** all of above in 3 and change cellpadding and font to 6pt;
title '4) using cellpadding and widths for all and font change';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(report)={cellpadding=3px}
style(column)={fontsize=6pt}
style(header)={backgroundcolor=cxE0E0E0};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ width=1.0in font_weight=bold textalign=left fontsize=6pt} ;
define atcclass / display "ATC Classification"
style(header)={ width=2.25in font_weight=bold textalign=left fontsize=6pt} ;
define indc / display "Indication"
style(header)={ width=1.25in font_weight=bold textalign=left fontsize=6pt} ;
define route / display "Route"
style(header)={width=1.25in font_weight=bold textalign=left fontsize=6pt} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ width=1.0in font_weight=bold textalign=left fontsize=6pt} ;
define medreas / display "Reason for Medication"
style(header)={ width=1.5in font_weight=bold textalign=left fontsize=6pt} ;
break before dummyvar / page contents="";
run;
ods pdf close;
Hope this helps. I find it is better to be explicit in your options statement as to the margins. I prefer the simple WIDTH=100% at the REPORT level (in the PROC REPORT statement -- as shown in #1) as an alternative to "over-controlling" each cell. PDF is very picky about the fonts and cellwidths and tries to use an internal algorithm to calculate cellwidths and I have experienced less problems overall with #1 technique than with the widths on each DEFINE technique.
I do see a visible difference when using cellpadding, it may not be desired because it shrinks the white space in the cell, but if all you need is a tiny bit more room, I find that taking the cellpadding to 3px or 5px will generally give me just an "ooch" more space.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
Your choices are to:
1) increase cellwidth explicitly
2) decrease font size
3) reduce cellpadding
Or, try one or more than one of the above style overrides. I notice that in your code, you show the use of HEADLINE and HEADSKIP and SPACING, which are not used by ODS PDF (these are LISTING only options), so if your issue is with wrapping in the LISTING destination, then the STYLE overrides will not impact the LISTING destination or output window. You do not show your orientation or your margin settings, but just adding up your widths in my head, I get over 8.5 inches, so I wonder if you've changed the margins or orientation.
You did not provide any data or show all of your ODS statements, so it is hard to make any other constructive suggestions.
cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Cynthia,
Apologies for not including more. Here's some dummy data and the template being used so that it replicates the problem upon running.
I didn't know that about spacing, headline annd headskip. We mostly create RTFs and I just carried over the options from that.
In this example code I tried changing the cell padding in the template definition and observed no difference. Also I have attempted to reduce the width of the column from 1.9 to 1.8 but I just notice that the problem shifts to words that run up against that threshold (in this dummy data, the 3rd entry then crosses).
Thank you again.
proc template;
define style mypdfstyle;
parent = styles.printer;
style fonts from fonts/
'headingFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'docFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'footFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'TitleFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'TitleFont2' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 10pt, Bold)
'StrongFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'EmphasisFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedEmphasisFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedStrongFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedHeadingFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'BatchFixedFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedFont' = ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'headingEmphasisFont'= ("Arial, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
;
style GraphFonts from GraphFonts /
'headingFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 8pt)
'docFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 8pt)
'footFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 8pt)
'TitleFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 10pt, Bold)
'GraphDataFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 6pt)
'GraphUnicodeFont' = ("<MTserif-unicode> ", 8pt)
'GraphValueFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 7pt)
'GraphLabelFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 8pt)
'GraphFootnoteFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 8pt)
'GraphTitleFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 10pt, Bold)
'GraphAnnoFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial", 7pt)
;
replace Body from Document /
bottommargin = 0.75in
topmargin = 1in
rightmargin =1in
leftmargin = 1in
;
style usertext from usertext /
font_size=8pt
font_weight=bold
;
replace Table from Output /
frame = BOX
rules = ALL
cellpadding = 1pt
;
style SystemTitle from SystemTitle "Controls system title text." /
protectspecialchars=off
foreground = black
background = white
;
style SystemFooter from SystemFooter "Controls system footer text." /
just=left
protectspecialchars=off
font = Fonts('FootFont')
;
replace color_list /
'link' = blue
'bgh' = white
'fg' = black
'bg' = white
;
end;
run;
data conmed;
length name atcclass route indc $200
date $40
medreas $100;
infile datalines DLM=",";
input dummyvar name $ atcclass $ indc $ route $ date $ medreas $;
datalines;
1,Drug 1/~nDrug 2,ATC CLASSIFICATION 1,Indication 1,Route 1,2099-99-99/~n2099-99-99,Reason 1
1,Drug 1/~nDrug 2,STOMATOLOGICAL PREPARATIONS,Indication 2,Route 2,2099-99-99/~n2099-99-99,Reason 2
1,Drug 1/~nDrug 2,ANTIBACTERIALS FOR SYSTEMIC USE,Indication 2,Route 2,2099-99-99/~n2099-99-99,Reason 2
;
run;
%let s_title=background=white font_weight=bold just=L borderleftcolor=white borderrightcolor=white bordertopcolor=white;
ods escapechar="~";
ods html close;
ods listing close;
options orientation=landscape;
ods pdf file="testfile.pdf" style=mypdfstyle;
proc report data=conmed list nowd missing split='#' wrap nocenter
style(header)={backgroundcolor=cxE0E0E0};
column ("~S={&s_title}Concomitant Medications" (dummyvar name atcclass indc route date medreas));
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name" style(header)={width=2.0in font_weight=bold textalign=left} left;
define atcclass / display "ATC Classification" style(header)={width=1.9in font_weight=bold textalign=left} left;
define indc / display "Indication" style(header)={width=1.5in font_weight=bold textalign=left} left;
define route / display "Route" style(header)={width=1.0in font_weight=bold textalign=left} left;
define date / display "Start Date(Day)/#End Date(Day)" style(header)={width=1.0in font_weight=bold textalign=left} left;
define medreas / display "Reason for Medication" style(header)={width=1.5in font_weight=bold textalign=left} left;
break before dummyvar / page contents="";
run;
ods pdf close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
I changed a few things in your code -- I got rid of REPLACE in the style template, which is was deprecated between 9.1 and 9.2 (see this paper by Kevin Smith: http://www2.sas.com/proceedings/sugi31/053-31.pdf on page 1-- the section that starts "Replace is Dead").
Here is the output I got by using your style and making different changes for width, cellpadding and font:
There is a visible difference to cellpadding between #2 and #3 and 4.
Here's the code I used:
ods path work.tt(update) sasuser.templat(update) sashelp.tmplmst(read);
proc template;
define style mypdfstyle;
parent = styles.printer;
style fonts from fonts/
'headingFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'docFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'footFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'TitleFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'TitleFont2' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 10pt, Bold)
'StrongFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'EmphasisFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedEmphasisFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedStrongFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedHeadingFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'BatchFixedFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'FixedFont' = ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
'headingEmphasisFont'= ("Arial Unicode MS, <sans-serif>, <MTsans-serif>, Helvetica, Helv", 8pt)
;
style GraphFonts from GraphFonts /
'headingFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'docFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'footFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'TitleFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 10pt, Bold)
'GraphDataFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 6pt)
'GraphUnicodeFont' = ("<MTserif-unicode> ", 8pt)
'GraphValueFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 7pt)
'GraphLabelFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'GraphFootnoteFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 8pt)
'GraphTitleFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 10pt, Bold)
'GraphAnnoFont' = ("<sans-serif>, <MTsans-serif>, Helvetica, Helv, Arial Unicode MS", 7pt)
;
class Body from Document /
bottommargin = 0.75in
topmargin = 1in
rightmargin =1in
leftmargin = 1in
;
style usertext from usertext /
font_size=8pt
font_weight=bold
;
class Table from Output /
frame = BOX
rules = ALL
;
style SystemTitle from SystemTitle "Controls system title text." /
protectspecialchars=off
foreground = black
background = white
;
style SystemFooter from SystemFooter "Controls system footer text." /
just=left
protectspecialchars=off
font = Fonts('FootFont')
;
class color_list /
'link' = blue
'bgh' = white
'fg' = black
'bg' = white
;
end;
run;
data conmed;
length name atcclass route indc $200
date $40
medreas $100;
infile datalines DLM=",";
input dummyvar name $ atcclass $ indc $ route $ date $ medreas $;
datalines;
1,Drug 1/~nDrug 2,ATC CLASSIFICATION 1,Indication 1,Route 1,2099-99-99/~n2099-99-99,Reason 1
1,Drug 1/~nDrug 2,STOMATOLOGICAL PREPARATIONS,Indication 2,Route 2,2099-99-99/~n2099-99-99,Reason 2
1,Drug 1/~nDrug 2,ANTIBACTERIALS FOR SYSTEMIC USE,Indication 2,Route 2,2099-99-99/~n2099-99-99,Reason 2
;
run;
%let s_title=background=white font_weight=bold just=L borderleftcolor=white borderrightcolor=white bordertopcolor=white;
ods escapechar="~";
ods html close;
ods listing close;
options orientation=landscape center date number
topmargin=1in bottommargin=.75in leftmargin=1in rightmargin=1in;
ods pdf file="c:\temp\testfile_width_report.pdf" style=mypdfstye ;
title '1) using simple width=100%';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(header)={backgroundcolor=cxE0E0E0}
style(report)={width=100%};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ font_weight=bold textalign=left} ;
define atcclass / display "ATC Classification"
style(header)={ font_weight=bold textalign=left} ;
define indc / display "Indication"
style(header)={ font_weight=bold textalign=left} ;
define route / display "Route"
style(header)={ font_weight=bold textalign=left} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ font_weight=bold textalign=left} ;
define medreas / display "Reason for Medication"
style(header)={ font_weight=bold textalign=left} ;
break before dummyvar / page contents="";
run;
title '2) using widths ONLY for ATCCLASS';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(header)={backgroundcolor=cxE0E0E0};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ font_weight=bold textalign=left} ;
define atcclass / display "ATC Classification"
style(header)={ width=2.25in font_weight=bold textalign=left} ;
define indc / display "Indication"
style(header)={ font_weight=bold textalign=left} ;
define route / display "Route"
style(header)={ font_weight=bold textalign=left} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ font_weight=bold textalign=left} ;
define medreas / display "Reason for Medication"
style(header)={ font_weight=bold textalign=left} ;
break before dummyvar / page contents="";
run;
title '3) using cellpadding and widths for all';
title2 'There is a visible difference between 1, 2 and 3';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(report)={cellpadding=3px}
style(header)={backgroundcolor=cxE0E0E0};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ width=1.0in font_weight=bold textalign=left} ;
define atcclass / display "ATC Classification"
style(header)={ width=2.25in font_weight=bold textalign=left} ;
define indc / display "Indication"
style(header)={ width=1.25in font_weight=bold textalign=left} ;
define route / display "Route"
style(header)={width=1.25in font_weight=bold textalign=left} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ width=1.0in font_weight=bold textalign=left} ;
define medreas / display "Reason for Medication"
style(header)={ width=1.5in font_weight=bold textalign=left} ;
break before dummyvar / page contents="";
run;
** all of above in 3 and change cellpadding and font to 6pt;
title '4) using cellpadding and widths for all and font change';
proc report data=conmed list nowd missing split='#' wrap nocenter
style(report)={cellpadding=3px}
style(column)={fontsize=6pt}
style(header)={backgroundcolor=cxE0E0E0};
column ("~S={&s_title}Concomitant Medications"
(dummyvar name atcclass indc route date medreas)
);
define dummyvar / order order=data noprint;
define name / display "Reported Name/#Preferred Name"
style(header)={ width=1.0in font_weight=bold textalign=left fontsize=6pt} ;
define atcclass / display "ATC Classification"
style(header)={ width=2.25in font_weight=bold textalign=left fontsize=6pt} ;
define indc / display "Indication"
style(header)={ width=1.25in font_weight=bold textalign=left fontsize=6pt} ;
define route / display "Route"
style(header)={width=1.25in font_weight=bold textalign=left fontsize=6pt} ;
define date / display "Start Date(Day)/#End Date(Day)"
style(header)={ width=1.0in font_weight=bold textalign=left fontsize=6pt} ;
define medreas / display "Reason for Medication"
style(header)={ width=1.5in font_weight=bold textalign=left fontsize=6pt} ;
break before dummyvar / page contents="";
run;
ods pdf close;
Hope this helps. I find it is better to be explicit in your options statement as to the margins. I prefer the simple WIDTH=100% at the REPORT level (in the PROC REPORT statement -- as shown in #1) as an alternative to "over-controlling" each cell. PDF is very picky about the fonts and cellwidths and tries to use an internal algorithm to calculate cellwidths and I have experienced less problems overall with #1 technique than with the widths on each DEFINE technique.
I do see a visible difference when using cellpadding, it may not be desired because it shrinks the white space in the cell, but if all you need is a tiny bit more room, I find that taking the cellpadding to 3px or 5px will generally give me just an "ooch" more space.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Cynthia,
Thank you for the reply. You are right, the cellpadding is making a difference, I just wasn't moving it in large enough values to notice the difference. I set the cellpadding to 5 and that seems to work well.
Thanks again!