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

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="cid:Sami_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.


Capture.JPG
1 ACCEPTED SOLUTION

Accepted Solutions
samuelll
Fluorite | Level 6

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

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

samuelll
Fluorite | Level 6
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.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Shmuel
Garnet | Level 18

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

samuelll
Fluorite | Level 6
That didn't work either. The border is removed around the actual text before and after the chart, but not around the image/graph.
samuelll
Fluorite | Level 6

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;

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
  • 6 replies
  • 4806 views
  • 0 likes
  • 3 in conversation