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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2512 views
  • 2 likes
  • 3 in conversation