Hello,
I would like to know how to add a hyperlink on a spanned header in a proc report with ods excel. I tried the 2nd solution offered by this answer but it didn't work in my case.
Re: URL in spanned headers of proc report - SAS Support Communities
Here is a sample code. I would like, by clicking on the 'EMPLACEMENT' header in the excel file, to open the TEST.xlsx file.
%LET FICHIER = file:///\\repertoire\information\TEST.XLSX;
DATA SHOES;
SET SASHELP.SHOES;
RUN;
ODS EXCEL FILE="\\repertoire\information\Rapport.xlsx";
PROC REPORT DATA= SHOES;
COLUMN ('EMPLACEMENT' Region Product)
('AUTRES' Subsidiary Stores Sales Inventory Returns);
RUN;
ODS EXCEL CLOSE;
Hi:
I found that only a slight modification of the posted program was needed in order to provide a different file for the AUTRES header, as shown below:
And, when I open the Rapport.xlsx file, you can see that I can examine the hyperlink for the AUTRES header and the file that opens when I click will be the c:\temp\autres.xlsx file:
So using 9.4M7, the format example worked for me for ODS Excel to specify 2 different files as the URL= value.
Cynthia
Then you could try first one .or @Cynthia_sas know the solution?
DATA SHOES;
SET SASHELP.SHOES;
RUN;
proc format;
value $ fmt
'EMPLACEMENT'='C:\TEMP\TEST.XLSX'
;
value $ color
'EMPLACEMENT'='blue'
;
value $ style
'EMPLACEMENT'='underline'
;
run;
ODS EXCEL FILE="c:\temp\Rapport.xlsx";
PROC REPORT DATA= SHOES nowd
style(header)={url=$fmt. color=$color. textdecoration=$style. };
COLUMN ("EMPLACEMENT" Region Product)
('AUTRES' Subsidiary Stores Sales Inventory Returns);
RUN;
ODS EXCEL CLOSE;
I would like to link to a different file for EMPLACEMENT and AUTRES, that's why I did not choose the 1st solution...
Hi:
I found that only a slight modification of the posted program was needed in order to provide a different file for the AUTRES header, as shown below:
And, when I open the Rapport.xlsx file, you can see that I can examine the hyperlink for the AUTRES header and the file that opens when I click will be the c:\temp\autres.xlsx file:
So using 9.4M7, the format example worked for me for ODS Excel to specify 2 different files as the URL= value.
Cynthia
It works perfectly!
Thank you 🙂
In your example, if I replace the file autres.xlsx by autres.pdf, can I specify the page number ? I already tried autres.pdf#page=3. I saw that it works in a ods html but I don't know if it can work in ods excel...
Hi,
By technical support, do you mean the contract my organization has witht sas company ?
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.