BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

Hi All,

I am working on a stored process that will be called from Excel Add-In, and will return a table to Excel.  The ODS destination is tagsets.sasreport12.

Having a problem where if Excel thinks the value in a cell is numeric, it treats it as such, and does not preserve leading/trailing zeroes.  So a character value of '01.0' in SAS becomes an Excel value of 1.

I have read the very helpful paper, Dont Gamble with Your Output: How to Use Microsoft Formats with ODS, and that describes how to use TAGATTR when destination is tagsets.ExcelXP and HTMLSTYLE for HTML destinations. Is there something similar I could use when the destination is tagsets.SASreport12 ?

I was able to preserve zeroes by prepending a single quote mark to character values, which I guess is a way in Excel to force a value to be text.  But then I get an ugly warning from Excel that I have a number formatted as text.

I suppose I may be better off switching to an HTML destination so that I can use HTMLSYLE? But just wanted to ask, before giving up on SASreport.

Appreciate any suggestions.

Thanks,

-Q.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Sadly, as you discovered, the TAGATTR and HTMLSTYLE methods only work with ExcelXP and MSOFFICE2K respectively. SASReport XML (what is created with SASreport12) is an internal format that can be rendered by many different client applications. So there is no way to make an impact in this destination.

  Possibly, if you changed your SP results to HTML-based (MSOFFICE2K) and used HTMLSTYLE style overrides, as discussed in my paper, then you might get somewhere with the Add-in for Excel. However, this might make your SP incompatible with client apps like Web Report Studio or PPT. But if you don't mind that, then I think using HTML based results is your best bet. At the current time, the SAS Add-in for Microsoft Office will not "accept" TAGSETS.EXCELXP flavor of XML, so for what you want to do, HTML is the only alternative.

cynthia

View solution in original post

4 REPLIES 4
LarryWorley
Fluorite | Level 6


Quentin,

You may have tried this, but have you tried the TAGATTR construct with tagsets.SASreport12?  If so what were the results?

Larry

Quentin
Super User

LarryWorley wrote:


Quentin,

You may have tried this, but have you tried the TAGATTR construct with tagsets.SASreport12?  If so what were the results?

Larry

No joy, unfortunately.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
Cynthia_sas
SAS Super FREQ

Hi:

  Sadly, as you discovered, the TAGATTR and HTMLSTYLE methods only work with ExcelXP and MSOFFICE2K respectively. SASReport XML (what is created with SASreport12) is an internal format that can be rendered by many different client applications. So there is no way to make an impact in this destination.

  Possibly, if you changed your SP results to HTML-based (MSOFFICE2K) and used HTMLSTYLE style overrides, as discussed in my paper, then you might get somewhere with the Add-in for Excel. However, this might make your SP incompatible with client apps like Web Report Studio or PPT. But if you don't mind that, then I think using HTML based results is your best bet. At the current time, the SAS Add-in for Microsoft Office will not "accept" TAGSETS.EXCELXP flavor of XML, so for what you want to do, HTML is the only alternative.

cynthia

Quentin
Super User

Thanks Cynthia,

I was thinking that might be answer, as if there were a way to do it via SASReport figure it would have been in your excellent paper (or excellent ODS book).  Just wanted to double check before making the jump to an HTML-based destination.  For most of what I have been doing, I've been using SPWA as the client, so incompatibility with WRS is not a problem.

--Q.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1612 views
  • 0 likes
  • 3 in conversation