The SAS Output Delivery System and reporting techniques

ods html proc report how to set an ID for table, header and body?

Reply
Occasional Contributor
Posts: 15

ods html proc report how to set an ID for table, header and body?

hi,

perhaps it's a stupid question, but I'm new to SAS and did not find a solution for that:

 

How can I tell PROC REPORT to produce a html output with a given table-id, header-id and body-id? Or a given class? 

I only found information about giving a cell a html-id.

 

I'm looking for a parameter for PROC REPORT like ID=ABC or CLASS=XYZ and result should be

<table class="xyz" id="table_ABC" summary="Procedure Report: Detailed and/or summarized report"> 

<thead id="thead_ABC">

...

<tbody id="tbody_ABC">

...

thank you very much in advance

 

 

 

PROC Star
Posts: 7,357

Re: ods html proc report how to set an ID for table, header and body?

If you sort your data according to (i.e., BY) some variable or set of variables (e.g., sex if using sashelp.class), and use the same by statement in your proc report, then you can use the #byvall parameter (e.g., title1 "Gender = #byvall"'

 

HTH,

Art, CEO, AnalystFinder.com

 

Super User
Posts: 10,476

Re: ods html proc report how to set an ID for table, header and body?

Perhaps a bit fragile and requiring a good understanding of the target destination but the RAW function in conjunction with Escapechar allows you to specify raw code for a destination. You would likely need to create what I think you are asking for in a break statement with BEFORE or AFTER as needed in a Style option.

Occasional Contributor
Posts: 15

Re: ods html proc report how to set an ID for table, header and body?

thank you for your answers. I came up with a client-side solution by setting the html-id by javascript after document creation.

But I will keep your advices in mind for similar tasks in the future.

 

SAS Super FREQ
Posts: 8,740

Re: ods html proc report how to set an ID for table, header and body?

Hi, there are some options you can work with HTMLCLASS=, HTMLID=, and HTMLSTYLE=, as described here: https://support.sas.com/rnd/base/ods/templateFAQ/Template_csstyle.html#htmlclass and
http://support.sas.com/documentation/cdl/en/odsadvug/69833/HTML/default/viewer.htm#p0xi2cygmfk0wkn1e...
and here's an example of using HTMLCLASS, HTMLID and ANCHOR=

use_HTMLCLASS_HTMLID.png

 


cynthia

Ask a Question
Discussion stats
  • 4 replies
  • 230 views
  • 0 likes
  • 4 in conversation