The SAS Output Delivery System and reporting techniques

ODS MSOFFICE2K Email body border

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

ODS MSOFFICE2K Email body border

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;
Attachment

Accepted Solutions
Solution
‎10-20-2015 09:47 AM
New Contributor
Posts: 3

Re: ODS MSOFFICE2K Email body border

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;

View solution in original post


All Replies
SAS Super FREQ
Posts: 8,643

Re: ODS MSOFFICE2K Email body border

Hi:
I do not generally email HTML directly in the body of an email because many email administrators do not allow HTML files to be sent and many email administrators change emails with HTML in the body to plain text.

My preferred method of working with emailing reports is to create the file first -- generally using RTF or PDF if the file needs to be printed and then attach the file created by ODS to the email message, such as shown here http://support.sas.com/kb/23/636.html in Example 2.

cynthia
New Contributor
Posts: 3

Re: ODS MSOFFICE2K Email body border

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

SAS Super FREQ
Posts: 8,643

Re: ODS MSOFFICE2K Email body border

Hi:
Unfortunately, it's not W3C CSS that is involved it is Microsoft flavor of CSS that is behind the scenes with MSOFFICE2K -- and I find Excel is dicey with border controls anyway. So your best bet for resolution is to work with Tech Support to even find out if what you want to do is possible and then how to do it.

cynthia
Solution
‎10-20-2015 09:47 AM
New Contributor
Posts: 3

Re: ODS MSOFFICE2K Email body border

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;
Post a Question
Discussion Stats
  • 4 replies
  • 609 views
  • 0 likes
  • 2 in conversation