BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ghosh
Barite | Level 11

Capture.JPG

 

 

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
SuzanneDorinski
Lapis Lazuli | Level 10

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;

Specify background color in ODS PDF TEXT statement to match color of ODS REGIONSpecify background color in ODS PDF TEXT statement to match color of ODS REGION

View solution in original post

3 REPLIES 3
SuzanneDorinski
Lapis Lazuli | Level 10

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;

Specify background color in ODS PDF TEXT statement to match color of ODS REGIONSpecify background color in ODS PDF TEXT statement to match color of ODS REGION

ghosh
Barite | Level 11
Suzanne,
Thank you! However, if I have another box with a slightly different color, how I would I handle that?
Aroop
SuzanneDorinski
Lapis Lazuli | Level 10

Use the slightly different color of the other box.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2213 views
  • 1 like
  • 2 in conversation