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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

View solution in original post

4 REPLIES 4
ballardw
Super User

What is the ODS style you use for HTML output?

DeaT
Obsidian | Level 7
I'm using the default style--there isn't much else other than the code I posted.

After I posted my original message, I noticed something else. If you right-click in Outlook and choose VIEW IN BROWSER, the gridlines are there. I even changed the borders to red to make sure I wasn't missing something: the border doesn't show up in the email message at all (even black), but it is displayed as expected in the browser view. I'm not sure what to make of it.

Thank you.
Cynthia_sas
SAS Super FREQ

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

DeaT
Obsidian | Level 7
Thank you, Cynthia.

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
  • 3227 views
  • 1 like
  • 3 in conversation