The SAS Output Delivery System and reporting techniques

Disable selection for ods html

Reply
Regular Contributor
Regular Contributor
Posts: 166

Disable selection for ods html

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..

SAS Super FREQ
Posts: 8,645

Re: Disable selection for ods html

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

Regular Contributor
Regular Contributor
Posts: 166

Re: Disable selection for ods html

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;

SAS Super FREQ
Posts: 8,645

Re: Disable selection for ods html

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

Post a Question
Discussion Stats
  • 3 replies
  • 402 views
  • 0 likes
  • 2 in conversation