The SAS Output Delivery System and reporting techniques

Formatting in ODS Excel Print_Header

Reply
Contributor
Posts: 24

Formatting in ODS Excel Print_Header

In tagsets.excelXP, I was able to add &B or &14 to make my header bold or 14 point font, etc.  This causes my xlsx ODS Excel book to be corrupt and unable to be opened.  Is there a solution?

SAS Super FREQ
Posts: 8,866

Re: Formatting in ODS Excel Print_Header

[ Edited ]

Hi:
What code did you use? Also, did you use TAGSETS.EXCELXP or ODS EXCEL. The approved file extension for ODS EXCEL is .XLSX and the approved file extension for TAGSETS.EXCELXP is .XML -- you should not use a file extension of .XLSX with TAGSETS.EXCELXP.

When I tested in 9.4, ODS TAGSETS.EXCELXP worked and made the header string bold and italic, as shown below. Then I tested in ODS EXCEL -- same code and I only changed 2 things -- I changed the destination to ODS EXCEL and I changed the file extension to .XLSX and that worked too.

cynthia

TAGSETS.EXCELXP test using file extension .XML

tagsets_bold.png

 

ODS EXCEL test using file extension .XLSX

ods_excel_header.png

Frequent Learner
Posts: 1

Re: Formatting in ODS Excel Print_Header

Hi process,
Have you tried the same file with. Xls extension?
SAS Super FREQ
Posts: 304

Re: Formatting in ODS Excel Print_Header

As Cynthia said, you must use .xml for the extension for files created by the ExcelXP tagset.  Do not use .xls or .xlsx, otherwise Excel will report an error when opening the file:

 

When you open a file in Microsoft Office Excel 2007 or later that contains content that does not match the files extension, you receive the following warning message: 

The file you are trying to open, 'name.ext', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?

 

Error opening file: "The file format differs from the format that the file name extension specifies"

http://support.microsoft.com/kb/948615

 

Vince DelGobbo

SAS R&D

Contributor
Posts: 24

Re: Formatting in ODS Excel Print_Header

Posted in reply to Vince_SAS

I'm not sure if you meant to reply to someone else, but my question was regarding using ODS Excel.  Have a good day.

SAS Super FREQ
Posts: 304

Re: Formatting in ODS Excel Print_Header

I did mean to reply to you.

 

Cynthia asked some questions but you haven't answered.  Without knowing the code you are using or the exact error message that you received, we can only guess at an answer.

 

You need to provide better information.

 

Vince DelGobbo

SAS R&D

Contributor
Posts: 24

Re: Formatting in ODS Excel Print_Header

Posted in reply to Vince_SAS
My information was fine. I asked about getting a bold header using ODS Excel and you responded with what format to use with ODS Tagsets.ExcelXP.

That's why I assumed you were lost - you answered a question that nobody asked. That's the same thing Cynthia did.

Have a good day.
SAS Super FREQ
Posts: 8,866

Re: Formatting in ODS Excel Print_Header

Hi: I'm sorry you feel I did not answer your question. However, in my posting, I showed the SAME code working in both TAGSETS.EXCELXP and ODS EXCEL to make the print header both BOLD and ITALIC in output from the ODS EXCEL destination and TAGSETS.EXCELXP destination.

The PRINT_HEADER suboption is the same in both destinations. Did I misunderstand your original question. In my screen shot for ODS EXCEL, the header IS bold.

cynthia
Ask a Question
Discussion stats
  • 7 replies
  • 596 views
  • 1 like
  • 4 in conversation