The SAS Output Delivery System and reporting techniques

Redlighting negative numbers not working

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

Redlighting negative numbers not working

Something missing?

ods tagsets.ExcelXP file='D:\Admin\CA_NIC.xml' style=printer;

ods tagsets.ExcelXP options(sheet_interval='bygroup' sheet_label='Distrct'

absolute_column_width = '6,10,11,11,25,10,25,6,6,6,30,25,11,11,11,11');

Title 'Current Quarter Assets vs. Previous Quarter';

Proc print data=Admin.Canicmerged noobs label split='*';

by lead_ofc_id;

var id_rssd;       

var    PctDiff    / Style={tagattr='format:0.00;[Red]\(0.00\)'};   

var    &qtr2    ;   

var    &qtr1    ;   

var    idrssd    ;   

var    supr_event_nr    ;


Accepted Solutions
Solution
‎10-22-2014 09:17 AM
Contributor
Posts: 20

Re: Redlighting negative numbers not working

The problem was that the field was formatted as NEGPAREN8.2 in the table.

As soon as I changed it to 8.2 and recreated the table - it worked.

Thanks all!

View solution in original post


All Replies
Esteemed Advisor
Posts: 6,646

Re: Redlighting negative numbers not working

Have you tried running your code with and without the / Style option and compared the resulting xml files?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Respected Advisor
Posts: 3,775

Re: Redlighting negative numbers not working

Sometimes style overrides don't work and you have to create new style elements.

proc template;                                               
  
define style styles.my_journal;                          
     
parent=styles.journal;                                 
     
style angle_header from header / tagattr = 'rotate:45';
     
style red_data from data    / tagattr='format:0.00;[Red]\(0.00\)';
     
end;                                                   
  
run;             

data test;
   do x = -1 ,1,-2,1,-100000;
     
output;
     
end;
  
run;
ods tagsets.excelxp file='~/red.xml' style=my_journal;
proc report nowd list;
  
columns x;
   define x / display style(column)=red_data style(header)=angle_header 'Traffic Light';
  
run;
ods tagsets.excelxp close;

10-22-2014 6-05-54 AM.png  
   
                                                             
Contributor
Posts: 20

Re: Redlighting negative numbers not working

Same result.  Is the number supposed to be stored by excel as text? Maybe I should change the format in the table.

Solution
‎10-22-2014 09:17 AM
Contributor
Posts: 20

Re: Redlighting negative numbers not working

The problem was that the field was formatted as NEGPAREN8.2 in the table.

As soon as I changed it to 8.2 and recreated the table - it worked.

Thanks all!

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 516 views
  • 3 likes
  • 3 in conversation