Hi
I am trying to use SAS proc print and ODS mail. The issue I am facing is while trying to add border in the table, I am able to print border in the SAS EG output window but the same code is not working in mail.
Below is the code I am using expected output and output I am getting.
Kindly Help.
Expected output (Output in SAS EG)
Output I am getting (Output in Email)
Code:
options emailsys=xxxx emailhost=mail.xxx.in emailport=xxx;
filename mail
email to=("xxx.com")
from="xxx.com"
subject="Testing"
content_type="TEXT/HTML";
ods html3 body = mail
style=htmlblue;
ods escapechar='^';
ODS TEXT="^S={font_face='Calibri' font_size=2 fontweight=Medium foreground=black}
<<<<<<Testing>>>>>>>";
proc print data=x
style(data)=[frame = box
bordercolor=black
background=white]
style(obsheader)={background=#C00000 color=white
font_size=7pt
bordercolor=black
just = c}
style(header)={background=#C00000 color=white
font_size=7pt
bordercolor=black
just = c}
style(obs)={background=white color=black
font_size=6pt
bordercolor=black};
run;
ods html3 close;
This could be caused by using a crappy mail-client like Outlook, in which even the most basic css features seem to be not yet implemented. Try adding
bordercolor=black borderwidth=1px borderstyle=solid
to the style-option.
no luck! this is not working
@upadhi wrote:
no luck! this is not working
Please post the code!
filename mail email from="xxxxxxx" to="xxxxxxxx" subject="with borders" content_type="text/html";
ods html body=mail;
proc print data=sashelp.class(obs=4) noobs style={bordercolor=black borderwidth=1px borderstyle=solid};
run;
ods html close;
filename mail clear;
Result:
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.