BookmarkSubscribeRSS Feed
deleted_user
Not applicable
hi:
I output a report with ods html with the style of sasweb,and the style of body is as following:
.Body
{
font-family: 'MS Hei', GothicBBB, Arial, Helvetica, sans-serif;
font-size: x-small;
font-weight: normal;
font-style: normal;
color: #003399;
background-color: #FFFFFF;
margin-left: 8px;
margin-right: 8px;
}
Now,I want to change the background-color,is it possible?
Thanks
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Have a look at the SAS support http://support.sas.com/ website and the SAS ODS documentation resources, particularly using PROC TEMPLATE. You will find product documentation and also supplemental technical papers on the topic.

Scott Barry
SBBWorks, Inc.
ChrisNZ
Tourmaline | Level 20
Rather than sending you back to the (awful) proc template doc, here is a method that always works.

1- List your style components.
proc template;
source styles.sasweb;
run;


2- Spot the line(s) you want to update.
Here, that would be
'docbg' = color_list('bgA');

3- Re-run the code that step one generated, after changing what you want, and create your new style:
3.1) The procedure call becomes
proc template;
define style Styles.Sasweb2;


3.2) The color list has a new color
style color_list
"Colors used in the default style" /
'fgD1' = cx666666
'fgC1' = cxCCCCCC
'fgB1' = cx000000
'bgA1' = cx6495ED
'fgA' = cx003399
'bgA' = cxffffff
'NEWBGCOL'=CXFF0000;


3.3)The color definition for document background becomes
'docbg' = color_list('NEWBGCOL');


Done! Call your custom style from now on.

I know there is a better way, where you call the parent's styles and just overwrite what you need, but the time needed to learn how to use proc template properly vs the very rare occasions when it is needed makes the investment not worth it (in my case at least). I would have thought there would be a code-generating GUI by now to design customs styles.
deleted_user
Not applicable
Thanks for your reply!I have spent so mush time on the proc template doc,but it works now.It's horrible!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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