Data visualization with SAS programming

How do I remove border around html4 ODS insert in email output

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

How do I remove border around html4 ODS insert in email output

Hi Guys

I need to add a graph into the body of an email to send to users. I'm using ODS HTML4 to compile the ODS output, attaching the graph as an attachment and then 'inserting' it into the body of the mail by adding this ...

 

ods HTML4 
text='
<div border-style: none!important>
<table border-style: none!important>
<IMG src="cidSmiley Frustratedami_AQ12" border="0" frameborder="0" cellspacing="0" cellpadding="0" border-style: none!important>
</table>
</div>
';

 

The graph appears in the email, but there's a border - not around the graph itself, but what looks like the container that I can't seem to get rid of.

Attachment

Accepted Solutions
Solution
‎01-19-2017 03:25 AM
New Contributor
Posts: 4

Re: How do I remove border around html4 ODS insert in email output

Hi guys ... got the issue resolved ... Turns out you can add a chart in a 'title' section (and footnote) of your ODS output. It then assumes the style changes you made and drops the border if that's what you've specified in your custom style.


data _null_;
filename OUTBOX email
subject = "blah blah blah blaaaaa"
to = "blabla@gmail.com"
type = "text/html"
ct = "text/html"
attach = ("/folder/where/file/is/image.png" name="TRENDL" inlined="myimage")

;
ods html4 body=OUTBOX style=myeditedstyle;
options nocenter nobyline pagesize=max;
;
run;


proc report data = VALIDATION style={font_size=8pt font=('Calibri') width=400 cellpadding=2 borderwidth=0 bordercolor=white};
title1 justify=left height=9pt font="Calibri" "some or whatever text you want here";
title2='<IMG src="cid:myimage">;

footnote1 justify=left height=9pt font="Calibri" "some more text if needed";
run;
ods html4 close;

View solution in original post


All Replies
Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: How do I remove border around html4 ODS insert in email output

So is the border present if you create just the graph output file?  Am trying to ascertain if this is a Graph question, or an ODS to HTML problem.  If its in the graph then:

ods graphics on /reset=all border=off noborder;

Should get rid of the border.

New Contributor
Posts: 4

Re: How do I remove border around html4 ODS insert in email output

The border is not present when I create just the graph output file. I've actually got those tags (border=off noborder) specified already as you have it indicated. I've been experimenting inside a proc template, inside the ODS email output and the proc sgrender step, but all to no avail. I certainly think it's an ODS to HTML problem. If I change 'html4' to 'html5', then the border actually DOES disappear in the email, buuuut then I get titles (SAS Output) at the top of the email and another title (The REPORT Procedure | Detailed and/or Summarized Report | Report 1"), which comes up ahead of a proc report table that I'm including in the email too. Then "no proctitle" doesn't do anything in terms of removing those titles either.
Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: How do I remove border around html4 ODS insert in email output

Generate the same thing using html4 and html5.  Then look at the underlying tagset output.  That should show what option is different.  I would imagine its a different setting in the tagset/style which needs setting, but can't check at the moment.

Super User
Posts: 1,090

Re: How do I remove border around html4 ODS insert in email output

I've googled for "sas ods html 4 border option" and hope that next link can help you:

 

http://support.sas.com/kb/55/410.html

New Contributor
Posts: 4

Re: How do I remove border around html4 ODS insert in email output

That didn't work either. The border is removed around the actual text before and after the chart, but not around the image/graph.
Solution
‎01-19-2017 03:25 AM
New Contributor
Posts: 4

Re: How do I remove border around html4 ODS insert in email output

Hi guys ... got the issue resolved ... Turns out you can add a chart in a 'title' section (and footnote) of your ODS output. It then assumes the style changes you made and drops the border if that's what you've specified in your custom style.


data _null_;
filename OUTBOX email
subject = "blah blah blah blaaaaa"
to = "blabla@gmail.com"
type = "text/html"
ct = "text/html"
attach = ("/folder/where/file/is/image.png" name="TRENDL" inlined="myimage")

;
ods html4 body=OUTBOX style=myeditedstyle;
options nocenter nobyline pagesize=max;
;
run;


proc report data = VALIDATION style={font_size=8pt font=('Calibri') width=400 cellpadding=2 borderwidth=0 bordercolor=white};
title1 justify=left height=9pt font="Calibri" "some or whatever text you want here";
title2='<IMG src="cid:myimage">;

footnote1 justify=left height=9pt font="Calibri" "some more text if needed";
run;
ods html4 close;

Post a Question
Discussion Stats
  • 6 replies
  • 125 views
  • 0 likes
  • 3 in conversation