BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jbiza09
Fluorite | Level 6

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;

border screen shot.png
1 ACCEPTED SOLUTION

Accepted Solutions
jbiza09
Fluorite | Level 6

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

4 REPLIES 4
Cynthia_sas
SAS Super FREQ
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
jbiza09
Fluorite | Level 6

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

Cynthia_sas
SAS Super FREQ
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
jbiza09
Fluorite | Level 6

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;

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3008 views
  • 0 likes
  • 2 in conversation