The SAS Output Delivery System and reporting techniques

msoffice2k percentage format in call define of proc report

Accepted Solution Solved
Reply
Regular Contributor
Regular Contributor
Posts: 156
Accepted Solution

msoffice2k percentage format in call define of proc report

Dear all,

I have a proc report which I output to ods tagset.msoffice2k. I use SAS 9.2 and Office XP.

In the proc report I'd like to format a number with the format percent10.2. Here is the code for the html output which works:

compute myfield;

     call define(_col_,'FORMAT',"percent10.2");

endcomp;

Can anybody tell me how to do this for the tagset msoffice2k ?

In a define statement this works with msoffice2k:

define myfield2 / style={htmlstyle='mso-number-format:0.00%'};

Unfortunately this does not work with the call define:

compute myfield;

     call define(_col_,'style',"style=[htmlstyle='mso-number-format:0.00%']");

endcomp;

nor anything similar like:

call define(_col_,'style',"htmlstyle=['mso-number-format:0.00%']");

Best wishes

Eva


Accepted Solutions
Solution
‎06-14-2012 08:49 AM
Regular Contributor
Regular Contributor
Posts: 156

Re: msoffice2k percentage format in call define of proc report

Dear all,

I tried a little mor and was surprised what works:

compute myfield;

     call define(_col_,'style','style={htmlstyle="mso-number-format:0.00%"}');

endcomp;

just changing the brackets to "style={htmlstyle='mso-number-format:0.00%'}" didn't work, but having single quotation marks around the style and double quotation marks around the mso-number-format worked.

Best wishes

Eva

View solution in original post


All Replies
Solution
‎06-14-2012 08:49 AM
Regular Contributor
Regular Contributor
Posts: 156

Re: msoffice2k percentage format in call define of proc report

Dear all,

I tried a little mor and was surprised what works:

compute myfield;

     call define(_col_,'style','style={htmlstyle="mso-number-format:0.00%"}');

endcomp;

just changing the brackets to "style={htmlstyle='mso-number-format:0.00%'}" didn't work, but having single quotation marks around the style and double quotation marks around the mso-number-format worked.

Best wishes

Eva

☑ This topic is SOLVED.

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

Discussion stats
  • 1 reply
  • 312 views
  • 0 likes
  • 1 in conversation