Date: Tue, 4 Jan 2005 12:23:52 -0500
Reply-To: Robert Sayre <rjsayre@THERAMP.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Robert Sayre <rjsayre@THERAMP.NET>
Subject: help with html output to xml
Hi,
I'm currently creating various proc tab reports with an .xls extension that
open in excel. I have a need to make changes to it such as making the
reports landscape, hiding columns, etc. To do this I think I need to use
xml. I can't get a simple test program to work. If I could get it to
work, I can use it as a base to do what I need. Help!
my sample program is below:
data data1;
name='george'; age='68'; output;
name='cheryl'; age='75'; output;
name='ed '; age='90'; output;
/*******************************************/;
/****** HTML setup for ccof reports ******/;
/****** HTML setup for ccof reports ******/;
/****** HTML setup for ccof reports ******/;
/*******************************************/;
ods html body = "test_xml.xls";
proc freq data=data1;
table age name;
ods proclabel='data from data1';
run;
ods html close ;
ods proclabel=" ";
/******************************************/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/****** XML setup ******/;
/*******************************************/;
proc template;
define tagset tagsets.test;
parent=tagsets.html;
define event doc;
start:
put '<html xmlns:o="urn:schemas-microsoft-com:office: office"' NL;
/***put 'xmlns:x="urn:schemas-microsoft-com:office:excel>"' NL ***/;
finish:
put "</html>" NL;
end;
define event doc_head;
start:
put "<head>" NL;
/* put '<meta name="Excel Workbook Frameset">'*/;
finish:
put "<!--[if gte mso 9]><xml>" NL;
put "<o:DocumentProperties>" NL;
put "<o:Title>Sugi 28</o:Title>" NL;
put "<o:Author>r.james</o:Author>" NL;
put "</xml><![endif]-->" NL;
put "</head>" NL;
end;
end;
run;
/************
put "<x:ExcelWorkbook>" NL;
put " <x:ExcelWorksheet>" NL;
put " <x:ExcelWorksheet>" NL;
put " <x:Name>Fred</x:Name>" NL;
put " </x:ExcelWorkbook>" NL;
put " <x:WorksheetOptions>" NL;
put " <x:DisplayPageBreak/>" NL;
put " <x:Print>" NL;
put " <x:PaperSizeIndex>5 </x:PaperSizeIndex>5" NL;
put " </x:Print>" NL;
put " </x:DisplayPageBreak/>" NL;
put " </x:WorksheetOptions>";
************/;
ods markup file="test_xml.xls"
tagset=tagsets.test
stylesheet='temp.css';
proc freq data=data1;
table age name;
ods proclabel='data from data1';
run;
ods markup close;
run;
endsas;
endsas;
endsas;