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>
Subject: Re: ODS to Excel
Content-Type: text/plain; charset=ISO-8859-1
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 */
DEFINE STYLE MinimalNoBorderRule;
REPLACE Output from Container /
background = colors('tablebg')
rules = NONE
frame = VOID
cellpadding = 7
cellspacing = 0
bordercolor = colors('tableborder')
borderwidth = 1;
/* This create the output files */
%let myfile ='/space/home/jnokes/output/OpenThisFirst.xls';
/* Create the Excel File */
ods html file = &myfile style = MinimalNoBorderRule;
ods html close;
I hope this helps.
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,
> %let rc = %sysfunc(appsrv header(Content-disposition,
> proc report follows..........
> Christo Engelbrecht
> Data Warehouse Consultant
> Tel. (012) 307 4303
> Cell 083 264 8197
> Fax (012) 307 3153
> Mail email@example.com