Hi,
I am trying to send a report as the body of an email message. If I output the data as PDF, the report retains its gridlines. However, in the body fo the email the data appears without gridlines.
I tried adding style(report)=[rules=all frame = hsides] in the PROC REPORT statement to no result.
I would appreciate any suggestions. Thank you.
DeaT
libname xxx "/path";
FILENAME outbox email
to=("xxx@xxx.com")
type='text/html'
subject="xxx";
ods listing close;
ods html body=outbox ;
options nodate pageno=1 linesize=189 ;
PROC REPORT data=xxx.contacts(obs=5) split='*' nowd;
label customer_name = 'Cust*Name' customer_id = 'Cust*ID' fname='First*Name' lname='Last*Name'
work_phone_ext='Work*Phone*Ext' email='E-mail' contact_type='Contact*Type' ;
column Customer_name customer_id fname lname
work_phone_ext email contact_type ;
define action / display;
define customer_id / display;
define customer_name / display;
define fname / display;
define lname / display;
define work_phone_ext / display;
define email / display;
define contact_type / display;
Footnote;
Title J=C "xxxs";
Footnote1 'Total Updates =' "xxxt";
run;
ods html close;
ods listing;
Hi, if the gridlines show when the output is viewed in the browser, then the issue is with the way the mail applications is causing the ODS HTML to be rendered. Once SAS is done with creating the HTML, it is up to the browser or other application to render the HTML into what you see on the screen.
In some browsers, the interior table lines are considered to be part of the background of the "web page" shown in the browser -- so sometimes when you printed the HTML page, the gridlines seemed to disappear. That sounds like what your mail program might be doing. You could "fiddle" with other styles, but the mail program might treat them the same way.
In the end, you may just need to educate the people who get the output that they should view the output in the browsers. Or stop sending them HTML output and send them a PDF file as an attachment and then they should be able to view in Acrobat, and/or print if they want.
cynthia
What is the ODS style you use for HTML output?
Hi, if the gridlines show when the output is viewed in the browser, then the issue is with the way the mail applications is causing the ODS HTML to be rendered. Once SAS is done with creating the HTML, it is up to the browser or other application to render the HTML into what you see on the screen.
In some browsers, the interior table lines are considered to be part of the background of the "web page" shown in the browser -- so sometimes when you printed the HTML page, the gridlines seemed to disappear. That sounds like what your mail program might be doing. You could "fiddle" with other styles, but the mail program might treat them the same way.
In the end, you may just need to educate the people who get the output that they should view the output in the browsers. Or stop sending them HTML output and send them a PDF file as an attachment and then they should be able to view in Acrobat, and/or print if they want.
cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.