The SAS Output Delivery System and reporting techniques

Problems with Spanned headers - unable to center

Reply
Occasional Contributor
Posts: 17

Problems with Spanned headers - unable to center

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
Super User
Posts: 19,051

Re: Problems with Spanned headers - unable to center

I thought Center was the default.

What happens if remove the style(header) portion?

Occasional Contributor
Posts: 17

Re: Problems with Spanned headers - unable to center

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

Super User
Posts: 19,051

Re: Problems with Spanned headers - unable to center

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

Occasional Contributor
Posts: 17

Re: Problems with Spanned headers - unable to center

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

Ask a Question
Discussion stats
  • 4 replies
  • 571 views
  • 3 likes
  • 2 in conversation