I am using ODS MSOFFICE2K to send emails with a proc report in the body. Everything seems to be working fine, but the body of the email has a border around it that I cannot figure out how to get rid of. I've tried ODS HTML3, and that got rid of the body border, but the formatting of my proc report doesn't seem to be as flexible with Outlook. Any suggestions are appreciated.
Code below. Attached is a screen shot.
filename mailit email
to=(&MGR_EML)
from='somebody@somewhere.com'
type='text/html'
subject="Subject";
ODS ESCAPECHAR='~';
ODS MSOFFICE2K FILE=MAILIT STYLE=MEADOW
OPTIONS(PAGEBREAK="NO");
title1 J=LEFT COLOR=BLACK FONT='Calibri' HEIGHT=11PT "&MGRNAME,";
title2 J=LEFT COLOR=BLACK FONT='Calibri' HEIGHT=11PT 'title';
footnote1 J=LEFT COLOR=BLACK FONT='Calibri' HEIGHT=11PT 'Please direct any questions regarding this email to ... ';
footnote2 J=LEFT COLOR=BLACK FONT='Calibri' HEIGHT=11PT 'Thank you,';
footnote3 J=LEFT COLOR=BLACK FONT='Calibri' HEIGHT=11PT 'Support';
footnote4 J=LEFT "~{STYLE[PREIMAGE='logo.gif']}";
PROC REPORT DATA=EMAIL_DATA NOWD
STYLE(HEADER)=[JUST=L BACKGROUND=LIGHT GREY COLOR=BLACK BORDERCOLOR=WHITE]
STYLE(REPORT)=[CELLSPACING=5 CELLPADDING=2];
COLUMN (EMPID) (EMPNME) (EFFDT) (GANGID) (REGTM_PC) (REGTM_BTM) (REGTM_ETM) (OT_PC) (OTTM_BTM) (OTTM_ETM) (MGRID) (M_NME);
DEFINE EMPID / LEFT DISPLAY 'Employee ID' STYLE (COLUMN)={TAGATTR='FORMAT:0000000'} MISSING;
DEFINE EMPNME / LEFT DISPLAY 'Employee' format=$50. MISSING;
DEFINE EFFDT / LEFT DISPLAY 'Date' STYLE(COLUMN)={TAGATTR='FORMAT:0000000000'} MISSING;
DEFINE GANGID / LEFT DISPLAY 'Gang' STYLE (COLUMN)={TAGATTR='FORMAT:00000000'} MISSING;
DEFINE REGTM_PC / LEFT DISPLAY 'Reg Pay Code' STYLE (COLUMN)={TAGATTR='FORMAT:00'} MISSING;
DEFINE REGTM_BTM / LEFT DISPLAY 'Reg Begin Time' STYLE (COLUMN)={TAGATTR='FORMAT:00000000'} MISSING;
DEFINE REGTM_ETM / LEFT DISPLAY 'Reg End Time' STYLE (COLUMN)={TAGATTR='FORMAT:00000000'} MISSING;
DEFINE OT_PC / LEFT DISPLAY 'OT Pay Code' STYLE (COLUMN)={TAGATTR='FORMAT:00'} MISSING;
DEFINE OTTM_BTM / LEFT DISPLAY 'OT Begin Time' STYLE (COLUMN)={TAGATTR='FORMAT:00000000'} MISSING;
DEFINE OTTM_ETM / LEFT DISPLAY 'OT End Time' STYLE (COLUMN)={TAGATTR='FORMAT:00000000'} MISSING;
DEFINE MGRID / LEFT DISPLAY 'Manager ID' STYLE (COLUMN)={TAGATTR='FORMAT:0000000'} MISSING;
DEFINE M_NME /LEFT DISPLAY 'Manager Name' format=$50. MISSING;
RUN;
QUIT;
run;
ODS _ALL_ CLOSE;
I was able to get past the body or page border in the email body by using a proc template. Apparently HTML/MSOFFICE2K ODS Meadow style generates a border around the page or body. This proc template got rid of the borders.
PROC TEMPLATE;
DEFINE STYLE STYLES.TEST;
PARENT=STYLES.MEADOW;
CLASS BODY /
HTMLSTYLE="BORDER:NONE";
CLASS SYSTITLEANDFOOTERCONTAINER /
HTMLSTYLE="BORDER:NONE";
CLASS PAGE /
HTMLSTYLE="BORDER:NONE";
END;
RUN;
Thank you for the reply Cynthia.
I agree with your preferred method of doing an attachment, but the business/users prefer simply viewing the report as glancing at an email. The administration piece is not an issue since these emails will be derived internally.
Do you have any suggestions on getting rid of the border? I'd prefer to stay away from CSS considering the border is just a mior styling change.
Thank you for the input.
Josh
I was able to get past the body or page border in the email body by using a proc template. Apparently HTML/MSOFFICE2K ODS Meadow style generates a border around the page or body. This proc template got rid of the borders.
PROC TEMPLATE;
DEFINE STYLE STYLES.TEST;
PARENT=STYLES.MEADOW;
CLASS BODY /
HTMLSTYLE="BORDER:NONE";
CLASS SYSTITLEANDFOOTERCONTAINER /
HTMLSTYLE="BORDER:NONE";
CLASS PAGE /
HTMLSTYLE="BORDER:NONE";
END;
RUN;
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.
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.