BookmarkSubscribeRSS Feed
NewSASPerson
Quartz | Level 8

I am trying center my spanned header and I am having difficulties. Any assistance would be great. Please see part of my code below.

ods _all_ close;

ods tagsets.excelxp

  file= "/servloc/myfolder/shoes.xls"

  style=seaside

  options (

  autofit_height = 'yes'

  row_repeat = '6'

  Wraptext = 'no'

  frozen_headers = '6'

  frozen_rowheaders='6'

  EMBEDDED_TITLES= 'yes'

  Orientation = 'landscape'

  sheet_interval = 'bygroup'

  suppress_bylines = 'yes'

  sheet_label = ' '

  );

  PROC report data=shoes nowd style(header)={just=center};

  Title1  j=left font='Cambria' height=12pt bold  "Approval Report";

  Title2  j=left font='Cambria' height=12pt bold   "November 2009 - October 2010"

  Title3  j=left font='Cambria' height=12pt bold  "Designer Name: #byval(brand)";

  by brand;

('12 MONTHS TOTAL' approved_0 denied_0 total_0 approval_rate_0)

  ("&month1" approved_1 denied_1 total_1 approval_rate_1)

  ("&month2" approved_2 denied_2 total_2 approval_rate_2)

  ("&month3" approved_3 denied_3 total_3 approval_rate_3)

  ("&month4" approved_4 denied_4 total_4 approval_rate_4)

  ("&month5" approved_5 denied_5 total_5 approval_rate_5)

  ("&month6" approved_6 denied_6 total_6 approval_rate_6)

  ("&month7" approved_7 denied_7 total_7 approval_rate_7)

  ("&month8" approved_8 denied_8 total_8 approval_rate_8)

  ("&month9" approved_9 denied_9 total_9 approval_rate_9)

  ("&month10" approved_10 denied_10 total_10 approval_rate_10)

  ("&month11" approved_11 denied_11 total_11 approval_rate_11)

  ("&month12" approved_12 denied_12 total_12 approval_rate_12);

  define RANK/computed style(column)={cellwidth=0.4in tagattr='format:#,##0'};

  define brand/'BRAND NAME';

  define approved_0 - approved_12/  style(column)={cellwidth=0.7in tagattr='format:#,##0'};

  define denied_0 - denied_12 /  style(column)={cellwidth=0.5in tagattr='format:#,##0'};

  define total_0- total_12/  style(column)={cellwidth=0.5in tagattr='format:#,##0'};

  define approval_rate_0 - approval_rate_12/ style(column)={cellwidth=0.6in just=right};

  compute RANK;

  rn+ 1;

  Rank = rn;

  endcomp;

run;

ods _all_ close;

This is what i get ... it left justifies the header instead of centering it. what am i doing wrong? Thanks.

12 MONTHS TOTALOCTOBER 2010SEPTEMBER 2010AUGUST 2010
RANKBRAND NAMEAPPROVEDDENIEDTOTAL% APPRVAPPROVEDDENIEDTOTAL% APRRVAPPROVEDDENIEDTOTAL% APRRVAPPROVEDDENIEDTOTAL% APPRV
4 REPLIES 4
Reeza
Super User

I thought Center was the default.

What happens if remove the style(header) portion?

NewSASPerson
Quartz | Level 8

Ok so I am not sure what happened the first time I ran it, it appeared to work removing the style(header), but upon rerunning it several times, it still comes up left justified even after I removed style(header)={just=center};

Message was edited by: Blessing Ekanem

Reeza
Super User

Works fine for me...what version of tagsets are you on.

You'll see the following in the log

NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.130,

08/02/2013). Add options(doc='help') to the ods statement for more information.

EDIT: I stand corrected, with your options on it doesn't work. It appears to be the WRAPTEXT option that causes the issues. Removing this will fix it though it may cause others Smiley Sad

NewSASPerson
Quartz | Level 8

Thanks actually removing the Wrap Text did not hurt my report. Thanks for your help.

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!

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.

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
  • 4 replies
  • 1225 views
  • 3 likes
  • 2 in conversation