BookmarkSubscribeRSS Feed
ramakanth
Calcite | Level 5

Hi friends

I have used the below query to fix the headers of html page and the problem is im not getting fixed headers directly in a mail but while storing the html page in another location and using the link in a mail  headers are fixed.

Can u please suggest me the correct way to fix headers of html page in mail.

QUERY

PROC template;
     define style styles.test;
     parent=styles.default;
       style table from table /
             outputwidth=99%
             prehtml='<DIV
                     style="overflow:auto;
                     WIDTH:100%;HEIGHT:400px"
                     id="data">'
             posthtml="</div>";
       style header from header /
             htmlstyle='z-index:20;
                       POSITION:relative;
                       TOP:
                       expression(document.getElementById("data").scrollTop-2)';
         end;
   run;

FILENAME myfile EMAIL TO=
from=""
subject=""
  type="text/html";
ods _all_ close;
ods HTML close;
ODS HTML BODY=myfile RS=NONE STYLE=styles.test;


   proc print data=sashelp.class noobs;
     id name age /
        style(header)={
             htmlclass="rowheader header"
             htmlstyle="z-index:30"};
     var _all_ / ;

   run;
ods html close;

3 REPLIES 3
Cynthia_sas
Diamond | Level 26

Hi:

  It's not clear to me what you are trying to do. You might investigate the HTMLSCROLL tagset template as a way to create output with headers that stay fixed when the table scrolls down on the page. If you search on support.sas.com for HTMLSCROLL, you should find some links.

  Next, some email systems do not allow HTML files to be sent in the body of and email. They want HTML files to be sent as attachments -- there are a lot of examples on how to do that on support.sas.com.

  Also, you may want to work with Tech Support on what you want to do here, because they have the expertise related to emailing using all the different techniques.

cynthia

ramakanth
Calcite | Level 5

Hi

Using the below code im getting the required output.

ie in the link that used in text dataset.

Headers are fixed for the html page stored in that location.

ODS HTML BODY='path';


   proc print data=sashelp.class noobs;
     id name age /
        style(header)={
             htmlclass="rowheader header"
             htmlstyle="z-index:30"};
     var _all_ / ;

   run;
ods html close;

data text;

length a $ 100.;

a='<a href=http://path > click here for report</a>';

run;

FILENAME myfile EMAIL TO=

from=""

subject=""

  type="text/html";

ods _all_ close;

ods HTML close;

ods html body=myfile style=normal;

proc print data=text;

run;

ods html close;

For the code posted in first disc. headers are not fixed.

Email system that we using have HTML page support

Cynthia_sas
Diamond | Level 26

Hi:

  It's still not entirely clear to me what you mean. If you want to know the difference between why or how the first posted code works compared to the second posted code, your best bet would be to work with Tech Support -- they have the email and the HTML expertise to help you figure out the answer to your question.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1316 views
  • 0 likes
  • 2 in conversation