BookmarkSubscribeRSS Feed
Jackie_Stanbank
Calcite | Level 5
i want to export files to excel with certain color formats on the headings.

how can i do this?
1 REPLY 1
Peter_C
Rhodochrosite | Level 12
here is a quick example that shows how proc print can define color to be used in foreground, background and dynamic based on the value of the cell (although it is data cells for which dynamic background color is derived).[pre]ods _all_ close ;
ods tagsets.excelxp file='demo.xml'(title='test1') style= default ;
ods tagsets.excelxp options( sheet_name='col1' ) ;
proc format ;
value ages 0-9 ='gray'
10-12='green'
13-14='yellow'
15-16='orange' other='white' ;
run;
proc print data= sashelp.class ;
id name /style(head)=[background=blue foreground = white] ;
var sex /style(head)=[ foreground = gray ] ;
var age /style(head)=[background=orange ]
style(data)=[font_weight=bold background=ages.] ;
run;
ods _all_ close ;
dm 'winexecfile "demo.xml" ' ;
ods listing ;[/pre]Hope you'll find it helpful.
For better guidance, look into the examples and notes for using ods tagsets.excelxp at http://support.sas.com/rnd/base/ods/odsmarkup/ .

peterC sheet_name not sheetname was edited by: Peter.C

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 657 views
  • 0 likes
  • 2 in conversation