BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BillB007
Obsidian | Level 7

The Proc Tabulate code below generates good looking HTML files but when I change the ODS format to RTF or PDF they look like hell.   The biggest problem is that the rows containing the data are all squished so the numbers aren't readable.   I don't really want to have a different version of Proc Tabulate for each ODS output type but if that's the only solution I'll do it. 

 

Also if I change the html file extension to .xls  it will open in Excel and look pretty good but Excel gives a warning message that the file is corrupt.

 

Any suggestions for either of those issues?   If I need to post sample outputs I'll be happy to.

 

 

--------------------   code -------------------

proc tabulate data =&input f=4.0 S=[just=c cellwidth=25]; 
var Col1;
class criterion instrument /ORDER=DATA ;
class _name_ ;
table instrument*criterion all={label='Total' s=[just=R background=goldenrod]}*{s=[background=goldenrod]} ,(_name_='Level' ALL)*Col1=" "*(sum="N"*(f=3.0) ROWPCTSUM="%"*f=mypct. ) /box=&reportdate; 
BY instrument NOTSORTED; 
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

1) You can't expect  they have the look in different ODS.

2) if You change the html file extension to .xml ,might get rid of that annonying warning message. I didn't test it ,just guess .

View solution in original post

4 REPLIES 4
Kurt_Bremser
Super User

Excel expects its old native format when a file has the extension .xls. The same is true for the otzher extensions and file formats.

HTML is HTML, RTF is RTF, XML is XML, XLS is XLS , and XLSX is XLSX. Don't obfuscate your data by using improper file extensions.

 

Your problem might be the graphics format that needs to be used in RTF or PDF. HTML allows embedding of ActiveX graphics, which look prettiest of all.

BillB007
Obsidian | Level 7

When I tried using ods excel options the results always looks terrible.   I read an article that suggested simply using ods html with an .xls extension.   That looks a lot better but it's still not perfect.  I should have said that this is using SAS 9.2.   I now see there are other ways of generating excel readable outputs.  I'll experiment with other options.  My report is very basic, no graphics or fancy stuff, just text and numbers and colors.

Ksharp
Super User

1) You can't expect  they have the look in different ODS.

2) if You change the html file extension to .xml ,might get rid of that annonying warning message. I didn't test it ,just guess .

BillB007
Obsidian | Level 7
changing the extension to .xml didn't help. Changing to ods excel didn't work because I'm using version 9.2 and I don't think it existed then. The best I've been able to do is use ods html with an .xls extension. It opens in Excel reluctantly, but it does!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 977 views
  • 1 like
  • 3 in conversation