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
SAS Super FREQ

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
SAS Super FREQ

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

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
  • 3 replies
  • 1124 views
  • 0 likes
  • 2 in conversation