BookmarkSubscribeRSS Feed
NN
Quartz | Level 8 NN
Quartz | Level 8

Hi all..

Is there any way that i can read protect my ods html outputs.. i.e. disable selection of the reports that i print in ods html .

If someone has done something in these lines maybe you could point me in the right direction.

Thanks..

3 REPLIES 3
Cynthia_sas
Diamond | Level 26

Hi:

  As far as I know, there are no ODS options to do this for ODS HTML. However, if you know system commands and can issue system commands, I suppose that after your job runs, you could issue an operating system command to make the files read-only.

cynthia

NN
Quartz | Level 8 NN
Quartz | Level 8

Thanks cynthia.. But what i was looking for was an option that would disable the user from selecting numbers or tables printed on an ods html.

I was able to get some commands and implement it in template. It does work to some extent but is not foolproof.


    proc template;
      define style test;
        parent=styles.normal;
        style body from body /
              prehtml="<div
  style='-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;'
  unselectable='on'
  onselectstart='return false;'
  oncontextmenu='return false;'
  onmousedown='return false;'
oncopy='return false;'
oncut='return false;'
onpaste='return false;'
>";
         style body from body /
              posthtml="</div>";
    end;
    run;


ods html file="/MYPATH/TEST.HTML" Style=test;
proc report data=sashelp.class;
run;
ods html close;

Cynthia_sas
Diamond | Level 26

Hi:

  If there's a JavaScript or scripting way to do what you want, or an HTML5 way to do what you want, you might be able to work with Tech Support to find it. When I was working on the ODS book, we used CODE= option to pass in some JavaScript for the browser, you might be able to do something like that...but my scripting language for browsers is limited to putting a counter or a button on the bottom of a page or designing an HTML form with an <ACTION> tag.

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
  • 1704 views
  • 0 likes
  • 2 in conversation