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) 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 .
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.
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.
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 .
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!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: