BookmarkSubscribeRSS Feed
chprby12
Calcite | Level 5

Can you show example code to add detail sheets to an ODS HTML sheet with highlighted rows and cells?

4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
I am not sure what you mean by "detail sheets" when you make an ODS HTML file, even from multiple SAS outputs, the HTML file is 1 HTML page. If you open the HTML file in Word, then it is 1 Word doc; if you open the HTML file with Excel then it is 1 Excel worksheet in 1 workbook. So there is not a concept of "multi-sheet" with ODS HTML. If you plan to open the SAS output file with Excel, you might be better served by looking at other destinations.

On the other hand, if you switch to ODS TAGSETS.EXCELXP or ODS EXCEL, then you can easily get multi-sheet workbooks.

Regarding your question about highlighted rows and cells -- the method you use for highlighting will depend on your procedure of choice. This paper outlines methods of highlighting in PROC PRINT, PROC REPORT and PROC TABULATE:
http://support.sas.com/resources/papers/proceedings13/366-2013.pdf
cynthia
chprby12
Calcite | Level 5

Hi,

 

I found out I can perform highlighting and also have multiple sheets in one workbook. I just have to revert to outputting to older Excel version, saving to an .xls file.

 

Thanks!

 

Reeza
Super User

@chprby12 wrote:

Hi,

 

I found out I can perform highlighting and also have multiple sheets in one workbook. I just have to revert to outputting to older Excel version, saving to an .xls file.

 

Thanks!

 


It depends on your version of SAS. If you have 9.4+ you can use ODS EXCEL and get a native XLSX file. 

 

ODS HTML will produce an HTML file, even if you label it xls. Excel will open it (most of the time) but you will have a warning pop up.

Reeza
Super User

HTML doesn't have the concept of pages or sheets. It's a continuous document, but you can link to other HTML pages or within the same document if you really wanted. 

 

If you search on LexJansen.com you'll fin a ton of examples and papers people have written on this topic.

 

http://www2.sas.com/proceedings/sugi28/023-28.pdf

 

https://www.mwsug.org/proceedings/2014/SA/MWSUG-2014-SA13.pdf

 

 

 

 

 

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