The SAS Output Delivery System and reporting techniques

ExcelXP Tagsets - XML file Error

Reply
Super Contributor
Posts: 275

ExcelXP Tagsets - XML file Error

Hi,
I am getting that too familiar error while opening up my xml file. I checked out the log file and it says this -

XML ERROR in Style
REASON: Too many tags
FILE: C:\Documents and Settings\r..p1\Local Settings\Temporary Internet Files\Content.IE5\EI82MDDN\tmp[1].xls
GROUP: Styles
TAG: Style
ATTRIB: ID
VALUE: SystemFooter

Any suggestions where to start troubleshooting. My code is rather complex and too long to post here. Just wondering if the SystemFooter the same as Footnote? Because I have this as my footnote -
ods escapechar='^';
footnote j=r height=1 color=black font=arial "Page ^{thispage} of ^{lastpage}";

Maybe this footnote works for ODS PDF output but not for ExcelXp tagsets?




Message was edited by: saspert
SAS Super FREQ
Posts: 8,864

Re: ExcelXP Tagsets - XML file Error

Hi:
TAGSETS.EXCELXP has its own method of using Microsoft "field codes" for inserting Page X of Y page numbering into the Worksheet XML. The suboption is the PRINT_FOOTER suboption, as shown below. It does NOT use ODS ESCAPECHAR syntax -- which was originally designed for the "paged" destinations of PDF and RTF.

XML and HTML are not "paged" destinations. The ONLY page control that you have when an HTML file or an XML file is opened in Excel is with an internal Microsoft page control syntax. TAGSETS.EXCELXP surfaces that "control" via the PRINT_HEADER and PRINT_FOOTER suboptions. Do note that in the code below, &L (for left justify), &R (for right justify), &C (center justify), &P (current page) and &N (total pages) are NOT SAS macro variables -- they are the Microsoft "codes" for modifying the header and footer in the XML, as described in the DOC='HELP' output in the SAS log.

For other problems with the generated XML, you might want to open a ticket with Tech Support.

cynthia
[pre]
ods listing close;

options topmargin=1in
bottommargin=1.5in
leftmargin=.5in
rightmargin=.5in;

ods tagsets.excelxp file='c:\temp\testfoot.xls' style=sasweb
options(doc='help' embedded_footnotes='yes'
print_footer_margin='0.5'
print_footer='&L One &C Two &R Page &P of &N');

title;
footnote;

proc print data=sashelp.shoes(obs=100);
var region product sales inventory;
run;

ods _all_ close;
[/pre]
Super Contributor
Posts: 394

Re: ExcelXP Tagsets - XML file Error

While I don't know if the footnote is the cause of the XML ERROR message, the doc is clear that THISPAGE and LASTPAGE aren't supported for ExcelXP:

[pre]
This function can be used only with the PRINTER, RTF, and TAGSETS.RTF destinations.
[/pre]
Super Contributor
Posts: 275

Re: ExcelXP Tagsets - XML file Error

Thank you Tim and Cynthia,
When I removed the footnote, I am getting back the output. You are correct when you say ExcelXP tagsets do not support that pageof functionality.

Regards,
saspert
Ask a Question
Discussion stats
  • 3 replies
  • 1135 views
  • 0 likes
  • 3 in conversation