BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'm using proc tabulate and outputting to excel through ODS html. I can't get any of the justification options in the style= command to work. Any suggestions? thanks.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Excel is very picky about how you specify style attributes in an HTML file. In fact, Excel is "happier" rendering HTML 3.2 tags, or Microsoft-specific HTML tags than it is rendering HTML 4.0 tags.
One thing you can try is to use a different method of creating your HTML and see whether the justification is handled differently:
[pre]
ods html3 file='ht3.html' style=sasweb;
ods msoffice2k file='mso.html' style=sasweb;
...your SAS code ...
ods _all_ close;
[/pre]

You can try either of these methods of creating HTML files and see if Excel accepts the justification attributes better.

Otherwise, you have a few other choices:
1) create a Spreadsheet Markup Language XML file using ODS TAGSETS.EXCELXP and see if the justification attributes are honored:
ods tagsets.excelxp file='xpfile.xls' style=sasweb;
...your SAS code ...
ods _all_ close;

[/pre]


2) With any of the HTML methods, investigate using the HTMLSTYLE attribute in a STYLE= override (for PRINT, REPORT or TABULATE) to see whether you can specify a justification attribute that will be respected by Excel)

3) With the XML-based ExcelXP method, investigate using the TAGATTR attribute in a STYLE= override to see whether you can specify a justification attribute that will be respected by Excel.)

Just remember that one of the areas of difference between Microsoft and the W3C, in respect to style attributes and CSS style specifications for HTML was in the area of text alignment and how and where that style attribute should be specified.

You may wish to work with Tech Support on this question, as they can look at your code and look at your data and advise you about the best approach.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 581 views
  • 0 likes
  • 2 in conversation