LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 22 May 2003 07:02:41 -0700
Reply-To:     "John N." <jnokes1@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "John N." <jnokes1@YAHOO.COM>
Organization: http://groups.google.com/
Subject:      Re: ODS to Excel
Content-Type: text/plain; charset=ISO-8859-1

Christo,

Another way to do it is to make an html ODS file, but when you name the file give it an .xls extension (from your example tmp.xls). Excel will open the file without difficulty. Upon opening, Excel will see that it is an HTML file and do an internal conversion to display it with the correct formats. Here is an example:

/* This is the template used for the Excel file */

PROC TEMPLATE; DEFINE STYLE MinimalNoBorderRule; PARENT=Styles.minimal; REPLACE Output from Container / background = colors('tablebg') rules = NONE frame = VOID cellpadding = 7 cellspacing = 0 bordercolor = colors('tableborder') borderwidth = 1; END; RUN;

/* This create the output files */

%let myfile ='/space/home/jnokes/output/OpenThisFirst.xls';

/* Create the Excel File */

ods html file = &myfile style = MinimalNoBorderRule;

Proc Report….

ods html close;

I hope this helps.

John

Christo.Engelbrecht@AST.CO.ZA (Christo Engelbrecht [HQP AST]) wrote in message news:<5C98067840AEF74EAE715B3CC0BB63010960C3@hqp-msg01.kumbaresources.com>... > I am using the following code to export a report to Excel. The report is > generated through proc report. > > I need to add title lines to the report that I export to Excel. If I > write the report to HTML the titles does display, > but as soon as I export it to Excel the titles disappear. > > Does anybody know how to add my titles to the exported report? > > %Macro TA; > Title1 "Trading Account"; > Title2 "By Company" ; > > ods listing close; > Ods csv body = webout > Style = procreport > Trantab = ascii; > %let rc = %sysfunc(appsrv header(content-type, > application/excel)); > %let rc = %sysfunc(appsrv header(Content-disposition, > filename="tmp.csv")); > > proc report follows.......... > etc. > > > > Christo Engelbrecht > Data Warehouse Consultant > Tel. (012) 307 4303 > Cell 083 264 8197 > Fax (012) 307 3153 > Mail christo.engelbrecht@ast.co.za > christoe@iafrica.com


Back to: Top of message | Previous page | Main SAS-L page