BookmarkSubscribeRSS Feed
Perry
Calcite | Level 5
I am using the ODS HTML statement to create an EXCEL report with a STYLE of Minimal. I am using TITLE '' to eliminate the SAS SYSTEM header, but how do I eliminate the 2 blank rows at the top of my output EXCEL file?? I want my EXCEL report to open with the column headings in row 1...Any suggestions?? Thanks..
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
Are you by any chance still running SAS 8? There used to be a problem with the ODS HTML tags that were written that generated some extra blank lines at the top of your HTML file (these blank lines are ignored in the browser, but not in Excel), but I thought that had been fixed in SAS 9.

At any rate, you can try these other methods of creating "plain" HTML files that Excel can open:
[pre]
options nodate nonumber;
title;
ods chtml file='c:\temp\cht.xls';
ods html4 file='c:\temp\ht4.xls' style=minimal;
ods htmlcss file='c:\temp\htcs.xls' style=minimal;

proc print data=sashelp.class;
run;

ods _all_ close;

[/pre]

Note that the CHTML method of creating HTML files does not need a STYLE= option because the "compact" HTML that is generated does not contain any style information.

cynthia
Perry
Calcite | Level 5
We are running SAS 9.1.3...........
Perry
Calcite | Level 5
Thanks....I will try these options and see what happens...
Perry
Calcite | Level 5
Thanks....The ODS CHTML option worked to eliminate the 2 blank rows but now my command, /STYLE={HTMLSTYLE="VND.MS-EXCEL.NUMBERFORMAT:@"}, in my VAR statement is not working. I am using this because I have several large numeric fields which I want to load in the EXCEL file as text and not come over as exponents....Any more ideas?? Thanks for your help....

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!

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
  • 752 views
  • 0 likes
  • 2 in conversation