BookmarkSubscribeRSS Feed
saspert
Pyrite | Level 9
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
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
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]
Tim_SAS
Barite | Level 11
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]
saspert
Pyrite | Level 9
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 2263 views
  • 0 likes
  • 3 in conversation