BookmarkSubscribeRSS Feed
Elliott
Obsidian | Level 7

Hello,

 

I am creating a report and the requester wants me to add a link to a SharePoint site on each record.  Each records has a separate SharePoint location.

 

I am also using SAS Enterprise Guide running on Linux with SAS 9.4.

 

I have a document that has the full address but when I read it in the join it just comes out as text in the output xls file.  I need to convert that text to a clickable link in my report output.  I am using ods and creating .xls files for the reports.  

 

I have tried proc report but I get the link comes out as text in the column.  I have tried creating a .xml but same result.

 

I would really like to use proc print because some of my variables I format there with tagattr..  (there may be a way to do that with proc report also but I have not figured it out yet).

 

I have read everything I can find but still cannot get it to work.  

 

my proc report looks like this:

ods tagsets.excelxp

 

file = rptfl style = XLsansPrinter

options(embedded_titles='on' minimize_style='yes' wraptext='no' AUTOFIT_HEIGHT='yes' )

;

 

ods tagsets.excelxp options(sheet_name = ' Zero Volume' sheet_interval='table' embedded_titles='yes' wraptext = 'no' autofilter='all'

absolute_column_width="15,15,25,15,15,40,15,15,15");

 

proc report nofs data=work.cards_zero_vol1 list;

columns _all_;

title "No Error Volume";

define link /display;

compute link ;

href=trim(link)||".html";

call define(_col_, "URL", href);

endcomp;

run;

 

ods tagsets.excelxp close;

 

TIA

Elliott

3 REPLIES 3
SuryaKiran
Meteorite | Level 14

Hi,

 

Write an EXCEL formula that displays the hyperlink. 

=HYPERLINK(<Link>,<Display Text>)

 

data class;
set sashelp.class;
Display_Link='=HYPERLINK("https://communities.sas.com/","SAS Community")';
run;


  ods tagsets.excelxp file="test_hyperlink.xls" style=statistical
      options( suppress_bylines='yes' sheet_interval='none' );
proc print data=class;
  run;

  ods tagsets.excelxp close;

 

 

Thanks,
Suryakiran
Elliott
Obsidian | Level 7

I got the links to work using proc report, but when I open the xls file that gets created I get the box that is in the attachment.  I just click ok and the report opens fine, but I know my users will have an issue with that.  How do I eliminate that box?  Am I missing a option or something?

 

this is my code:

ods tagsets.excelxp

 

file = rptfl style = XLsansPrinter

options(embedded_titles='on' minimize_style='yes' wraptext='no' AUTOFIT_HEIGHT='yes'  )

;

 

/*vol tab*/

ods tagsets.excelxp options(sheet_name = 'Zero Volume' sheet_interval='table'embedded_titles='yes' wraptext = 'no' autofilter='all'

absolute_column_width="15,18,25,12,15,30,80");

 

proc report nofs data=work.myfile list;

    title "No Error Volume";

   column DT REPORT_NO REPORT_ID TOT_ERRS TOT_VOL COMMENTS LINK;

   define TOT_ERRS / style(column)=[tagattr='format:#,##'];

   define TOT_VOL / style(column)=[tagattr='format:#,##'];

   define link /display;

   compute link ;

     href=trim(link)||".html";

    call define(_col_, "URL", href);

    endcomp;

   run;

Thanks,

ChrisNZ
Tourmaline | Level 20

Many people cannot/will not open MS Office files. Avoid them.

 

If you are attaching an image use the "Photos" icon.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3715 views
  • 4 likes
  • 3 in conversation