I am stumped trying to display text in an ODS layout region in a shaded area.
The problem is the text is displaying on a white background rather than on the color specified as the background color
as shown in the attached picture.
ods _all_ close;
options nonumber nodate orientation=landscape papersize=tabloid nocenter
leftmargin=2cm rightmargin=2cm topmargin=1cm bottommargin=1.5cm;
ods escapechar='^';
ods pdf file="fname.pdf" dpi=300 notoc;
/*absolute*/
ods layout start
style={bordercolor=black borderstyle=solid borderwidth=.5pt};
ods region x=0.0cm y=0.0cm height=0.5cm width=25cm
style={bordercolor=black borderstyle=solid borderwidth=.5pt background=BWH});
ods pdf text="^S={just=c vjust=c height=10pt}Highlights";
The destination is PDF, I am using SAS 9.4_M3
Any suggestions how I can fix this problem? The relevant parts of the code is below.
Thanks
The PDF destination uses the Pearl style by default. The background color is white by default, so you need to specify the color you want. Add BACKGROUND=BWH to the style portion of the ODS PDF TEXT statement.
ods _all_ close;
options nonumber nodate orientation=landscape papersize=tabloid nocenter
leftmargin=2cm rightmargin=2cm topmargin=1cm bottommargin=1.5cm;
ods escapechar='^';
ods pdf file="/folders/myfolders/ODS PDF/fname.pdf" dpi=300 notoc;
/*absolute*/
ods layout start
style={bordercolor=black borderstyle=solid borderwidth=.5pt};
ods region x=0.0cm y=0.0cm height=0.5cm width=25cm
style={bordercolor=black borderstyle=solid borderwidth=.5pt background=BWH};
ods pdf text="^S={just=c vjust=c height=10pt background=bwh}Highlights";
ods layout end;
ods pdf close;
The PDF destination uses the Pearl style by default. The background color is white by default, so you need to specify the color you want. Add BACKGROUND=BWH to the style portion of the ODS PDF TEXT statement.
ods _all_ close;
options nonumber nodate orientation=landscape papersize=tabloid nocenter
leftmargin=2cm rightmargin=2cm topmargin=1cm bottommargin=1.5cm;
ods escapechar='^';
ods pdf file="/folders/myfolders/ODS PDF/fname.pdf" dpi=300 notoc;
/*absolute*/
ods layout start
style={bordercolor=black borderstyle=solid borderwidth=.5pt};
ods region x=0.0cm y=0.0cm height=0.5cm width=25cm
style={bordercolor=black borderstyle=solid borderwidth=.5pt background=BWH};
ods pdf text="^S={just=c vjust=c height=10pt background=bwh}Highlights";
ods layout end;
ods pdf close;
Use the slightly different color of the other box.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.