The SAS Output Delivery System and reporting techniques

Help with ODS ExcelXP errors using STYLE=minimal

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Help with ODS ExcelXP errors using STYLE=minimal

Greetings!

I have been acclimating myself to the ODS ExcelXP facility lately and I've run into an issue generating files.  The issue only occurs when using the "minimal" style oddly. The SAS log does not generate any errors but when attempting to open the spreadsheet (via Excel 2010) I run into the following error.  Other styles work perfectly and do not generate errors - just minimal.  I've verified that the "minimal" style works perfectly with other outputs (HTML, PDF).  I've even opened the style CSS itself and confirmed it's existence.  It does not matter if I use the extention .xls or .xml...same error.   Any help would be much appreciated!

Thank you!!!

SAS Mike

Excel error upon attempt to open:

Error.jpg

Here's the Excel log file:

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

XML ERROR in Table

REASON: Bad Value

FILE: C:\Users\kj1062\Desktop\myexcel.xls

GROUP: Row

TAG: Cell

ATTRIB: StyleID

VALUE: notecontent__c

Here's my SAS code:

ODS TAGSETS.ExcelXP

  FILE="C:\Users\kj1062\Desktop\myexcel.xls"

  STYLE=minimal

  OPTIONS  ( EMBEDDED_TITLES='Yes'

  SHEET_NAME='PROC PRINT'

  FROZEN_HEADERS='3');

TITLE BOLD COLOR=BLACK "ODS Excel Test - PROC PRINT";

PROC PRINT DATA=SASHELP.CARS OBS='Observation #' SPLIT='*'; *SPLIT implies LABEL;

  VAR Make / STYLE=[JUST=RIGHT TAGATTR='format:text'];

  VAR MSRP;

  WHERE Make='Audi';

RUN;

ODS TAGSETS.ExcelXP

  OPTIONS  ( SHEET_NAME='PROC REPORT');

TITLE BOLD COLOR=RED "ODS Excel Test - PROC REPORT";

PROC REPORT DATA=SASHELP.CARS (WHERE=(Make='Porsche')) MISSING NOWD

  STYLE(HEADER)=[FONT_WEIGHT=BOLD JUST=CENTER BORDERWIDTH=1]

  STYLE(COLUMN)=[JUST=CENTER BORDERWIDTH=1];

  COLUMN Make MSRP;

  DEFINE MSRP / F=DOLLAR20.;

  COMPUTE AFTER /* STYLE=[] */;

  LINE "";

  LINE "1. Footnote one";

  LINE "2. Footnote two";

  LINE "https://www.google.com";

  ENDCOMP;

RUN;

ODS TAGSETS.ExcelXP CLOSE;


Accepted Solutions
Solution
‎01-14-2014 11:07 PM
SAS Super FREQ
Posts: 8,820

Re: Help with ODS ExcelXP errors using STYLE=minimal

Hi:

  Did you search support.sas.com? This Tech Support note (39769 - An incorrect file might be generated when using version 1.86 and below of the ExcelXP tagset...) seems to indicate that there is some kind of known problem, which, if encountered, should lead you to contact Tech Support. BTW, in SAS 9.4, there is still a problem with STYLE=MINIMAL and TAGSETS.EXCELXP, but the code ran fine using STYLE=SASWEB.

cynthia

View solution in original post


All Replies
Super User
Posts: 11,144

Re: Help with ODS ExcelXP errors using STYLE=minimal

The LINE statements in the Compute After block if your set up is similar mine, SAS 9.2.3,

reference a style ID that was not defined the XML style definitions.

 

StyleID="notecontent__c"

At least when I manually edit the XML with another defined style replacing that the result displays in Excel.


Occasional Contributor
Posts: 12

Re: Help with ODS ExcelXP errors using STYLE=minimal

I'm not sure why :smileyconfused: but when using the 'minimal' style, there are issues when using a COMPUTE block.  The errors that are generated relate directly to those COMPUTE lines.  Unless someone has a solution, I'll have to build a workaround.

Appreciate your response ! Smiley Happy

  COMPUTE AFTER /* STYLE=[] */;

  LINE "";

  LINE "1. Footnote one";

  LINE "2. Footnote two";

  LINE "https://www.google.com";

  ENDCOMP;

The four COMPUTE lines each generate an error in the Excel log file. 

Solution
‎01-14-2014 11:07 PM
SAS Super FREQ
Posts: 8,820

Re: Help with ODS ExcelXP errors using STYLE=minimal

Hi:

  Did you search support.sas.com? This Tech Support note (39769 - An incorrect file might be generated when using version 1.86 and below of the ExcelXP tagset...) seems to indicate that there is some kind of known problem, which, if encountered, should lead you to contact Tech Support. BTW, in SAS 9.4, there is still a problem with STYLE=MINIMAL and TAGSETS.EXCELXP, but the code ran fine using STYLE=SASWEB.

cynthia

Occasional Contributor
Posts: 12

Re: Help with ODS ExcelXP errors using STYLE=minimal

That explains a lot.  I will have to incorporate another style to circumvent this issue.  

Thank you very much !!! Smiley Happy

Occasional Contributor
Posts: 12

Re: Help with ODS ExcelXP errors using STYLE=minimal

Solution Follow-Up:

I was able to find a solution to this problem by installing the newest version of the ExcelXP tagset from this link:  Base SAS: ODS MARKUP

There is a help note about installation here: 32394 - Installing and Storing Updated Tagsets for ODS MARKUP

This solved the issues I was having with the 'minimal' style.  I cannot guarantee this will solve the issue for everyone, however, it did work for me.

Thanks all! Smiley Wink

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 1914 views
  • 3 likes
  • 3 in conversation