I want to modify existing SAS style template. The template is choose to modify is festival. These are what I want to add into the existing template.
1. 1. Change margins
2. 2. Create borders
3. 3.Change the color of header (background =light blue and font color = dark blue)
4. 4.Change title background and font color and increate the height of the cell
5. 5.Change the font and font size throughout the report to be Calibri
6. 6.Shade every other row in the report.
With a lot of help from SAS documentation, I was able to implement most of the changes except these.
Can someone please help me do these things?
1. 1.Set margins to (top=0.7 bottom=0.7 left=.75 right=.75)
2. 2.Shade every other row
3. 3.Increate title cell height and title font color
Can you please tell me if I’m doing something wrong?
here is a copy of my code:
libname here ".";
ODS PATH here.ismreport_store(w) sasuser.templat(read) sashelp.tmplmst(read);
*ods path sasuser.ismreport(U);
proc template;
define Style styles.ismreport;
class SystemTitle /
cellspacing = 3 in
font_face = 'calibri';
class SystemFooter /
font_face = 'calibri'
foreground=cxe0e0e0
backgroundcolor = #366092 ;
class Header /
fontfamily = 'calibri'
fontweight = bold
foreground= #4377B6
backgroundcolor = #DCE6F1
bordertopcolor = #C8B2CC
borderbottomcolor = #C8B2CC
borderrightcolor = #C8B2CC
borderleftcolor = #C8B2CC
fontsize = 12pt;
class titlesandfooters /
fontfamily = 'calibri'
fontsize = 12pt;
class procTitle /
fontfamily = 'calibri'
fontsize = 12pt;
style Table /
bordertopwidth = .75in
borderrightstyle = solid
bordertopcolor = #560467
cellspacing = 1
cellpadding = 7
frame = box
borderbottomcolor = #560467
backgroundcolor = white
borderbottomwidth = .75in
borderbottomstyle = solid
fontweight = bold
borderrightwidth = .70in
verticalalign = middle
fontfamily = 'calibri'
borderleftstyle = solid
borderrightcolor = #560467
borderleftwidth = .70in
borderleftcolor = #560467
fontsize = 10pt
color = black
bordertopstyle = solid;
style Note /
bordertopwidth = .75in
borderrightstyle = solid
bordertopcolor = #560467
padding = 3
borderbottomcolor = #560467
backgroundcolor = white
borderbottomwidth = .75in
borderbottomstyle = solid
fontweight = bold
borderrightwidth = .70in
verticalalign = middle
fontfamily = 'calibri'
borderleftstyle = solid
borderrightcolor = #560467
borderleftwidth = .70in
borderleftcolor = #560467
verticalalign = middle
textalign = center
fontsize = 10pt
color = cx000000
bordertopstyle = solid;
style Data /
bordertopwidth = .75in
borderrightstyle = solid
bordertopcolor = #C8B2CC
padding = 3
borderbottomcolor = #C8B2CC
borderbottomwidth = .75in
borderbottomstyle = solid
fontweight = medium
borderrightwidth = .70in
verticalalign = _undef_
fontfamily = 'calibri'
borderleftstyle = solid
borderrightcolor = #C8B2CC
borderleftcolor = #C8B2CC
textalign = _undef_
fontsize = 10pt
borderleftwidth = .70in
bordertopstyle = solid;
style BodyText /
fontsize = 10pt
fontfamily = 'calibri'
color = black;
style Body /
bottommargin = .75in
topmargin = .75in
rightmargin = .70in
leftmargin = .70in;
style systemtitle /
font_face = 'calibri'
cellspacing = 3 in
cellpadding = 7
frame = box
bordertopcolor = #C8B2CC
borderbottomcolor = #C8B2CC
borderrightcolor = #C8B2CC
borderleftcolor = #C8B2CC;
style fonts /
'fixed' = 'calibri';
style Header /
foreground = #326099
background = #DCE6F1
fontfamily = fonts('fixed');
style contentfolder;
style startupfunction;
style shutdownfunction;
style footer from header;
style footerempty from footer;
style footerfixed from footer /
fontfamily = fonts('fixed');
style footeremphasis from footer /
fontstyle = italic;
style footeremphasisfixed from footerfixed /
fontstyle = italic;
style footerstrong from footer /
fontweight = bold;
style footerstrongfixed from footerfixed /
fontweight = bold;
style rowheader from header /
textalign = left;
style rowheaderempty from rowheader;
style rowheaderfixed from rowheader /
fontfamily = fonts('fixed');
style rowheaderemphasis from rowheader /
fontstyle = italic;
style rowheaderemphasisfixed from rowheaderfixed /
fontstyle = italic;
style rowheaderstrong from rowheader /
fontweight = bold;
style rowheaderstrongfixed from rowheaderfixed /
fontweight = bold;
style rowfooter from rowheader;
style rowfooterempty from rowfooter;
style rowfooterfixed from rowfooter /
fontfamily = fonts('fixed');
style rowfooteremphasis from rowfooter /
fontstyle = italic;
style rowfooteremphasisfixed from rowfooterfixed /
fontstyle = italic;
style rowfooterstrong from rowfooter /
fontweight = bold;
style rowfooterstrongfixed from rowfooterfixed /
fontweight = bold;
end;
define table table.ismreport;
column _all_;
cellstyle MOD(_row_, 2) as {foreground=black backgroundcolor=#F2F2F2};
end;
run;
Hi:
Depending on your destination, #1 may or may not be respected, but for RTF and PDF, you should be able to just use an OPTIONS statement to change the margins (HTML and CSV, for example, don't use the margins).
For #2, you can't do this in a style template, by itself, (you actually did not say what kind of template you were creating, but from your changes, I assume you mean a style template). PROC REPORT can alternate every color pretty easily; or there is a table template method that works to do alternate highlighting. I believe there have been previous forum postings. I am teaching today and can't post anything or search until later.
For #3 you could simply change the title color in the title statement:
title color=purple font='Calibri' h=18pt 'My Purple Title';
Generally, the font size or height is going to determine how "high" the title line is. If you have successfully changed the title font to Calibri in your style template, then that would be the same place that you change the font size. And usually, that is enough to change the height.
cynthia
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.