The SAS Output Delivery System and reporting techniques

Tableeditor tagset - autofilter with long URLs

Reply
Occasional Contributor
Posts: 5

Tableeditor tagset - autofilter with long URLs

[ Edited ]

I am using proc report to summarize a dataset, output a HTML webpage, and provide URL links to other webpages. Within the proc report statement, the URL is generated within a compute block. I want to add filtering and sorting using

 

   compute P1;
      if  P1*1 > 90 then do;
         call define (_col_,'style','style={background=verylightgreen}');
      end;
      if  P1*1 < 90 then do;
         call define (_col_,'style','style={background=verylightorange}');
      end;
     if  P2*1 < 70 then do;
         call define (_col_,'style','style={background=verylightred}');
      end;
      urlstring2 = "&url_string_1.&url_string_2.&url_string_3 &url_string_4'"||trim(left(text_value))|| "'&parmfilters=P1#summaryLevel=text_value"|| "&url_string_6.&url_string_7.&url_string_8.&url_string_9.P1";
      call define (_COL_,'URL',urlstring2);
   endcomp;



ods tagsets.tableeditor file='my_file.html'
     options(autofilter="yes"
             autofilter_width="7em"
             autofilter_table="1"
             sort="yes"
             ) style=styles.sasweb ;

This works well, except that the autofiltering drop down filters on the embedded URL rather than the value of the column. The embeeded URL is quite long and not intuative as a filter. Is there a way to change this behavior so the filtering occurs on the value rather than the URL string?

 

Thanks

Super User
Posts: 11,101

Re: Tableeditor tagset - autofilter with long URLs

You may need to post some example data and enough code to duplicate generating an output for testing. A shorter dummy URL string should suffice to see what is happening.

Occasional Contributor
Posts: 5

Re: Tableeditor tagset - autofilter with long URLs

Thank you for the quick response.

Here is a snippet of code that demonstrates the issue

proc sql;
   create table cars as
   select distinct make,
                   type,
                   count(type) as type_count
   from sashelp.cars
   group by make, type
   order by make, type
;
quit;

 %include '~/tableeditor/tableeditor.tpl';

 ods tagsets.tableeditor file='~/filter_demo.html'
      options(autofilter="yes"
              autofilter_width="4em"
              autofilter_table="1"
              sort="yes"
              ) style=styles.sasweb ;


 proc report data = cars nowd;
    column make type type_count;
    define make / display;
    define type / display;
    define type_count / display;
    compute type_count;
       url_string = "https://www.google.com/#q="||trim(make);
       call define (_COL_,'URL',url_string);
    endcomp;
 run;

ods tagsets.tableeditor close;

bwalsh1

Ask a Question
Discussion stats
  • 2 replies
  • 297 views
  • 0 likes
  • 2 in conversation