BookmarkSubscribeRSS Feed
mtrapani
Calcite | Level 5

When using the indent feature (for example: call define ("description" , 'STYLE', 'STYLE=[INDENT=4]') ), the xml file that is created only shows indents of 2, no matter what value is entered.  When the proc report is output in HTML, the indents are rendered correctly, such that indent=XXX will indent however much XXX is indicated.  When using tagsets.excelxp however, no matter what value is indicated in indent=XXX, the indent is only 2 "tabs" from the margin.  I would appreciate any insight.

SAS 9.4 TS Level 1M2, Windows 7 Pro 64 bit, MS Office 2013

Here is a code snippet, with the area in question in bold (near the bottom):

ods tagsets.Excelxp file='<...\faculty-f14.xml' style=printer options(sheet_name="Tenure Track" sheet_interval='proc' width_fudge='0.5' frozen_headers='yes' frozen_rowheaders='1' embedded_footnotes='yes' index='yes');

proc report data=ttheads4 nowd

style(header)={font_face='Calibri'}

style(column)={font_face='Calibri' tagattr='format:##,###;-##,###;0' /*backgroundcolor=#FFFFFF*/};

/*style(lines)={font_face='Calibri' backgroundcolor=#FFFFFF};*/

footnote bcolor='#FFFFFF' "*Figures include faculty who are on leave without pay, on sabbatical.";

footnote2 bcolor='#FFFFFF' "**Faculty with split appointments are counted in only their berth department.";

  column description schlrank divrank unitrank factype _&ym9 _&ym8 _&ym7 _&ym6 _&ym5 _&ym4 _&ym3 _&ym2 _&ym1 _&year;

  define description /display '';

  define schlrank /display noprint '';

  define divrank /display noprint '';

  define unitrank /display noprint '';

  define factype /display noprint '';

  define _&ym9 /display "&yyyym9";

  define _&ym8 /display "&yyyym8";

  define _&ym7 /display "&yyyym7";

  define _&ym6 /display "&yyyym6";

  define _&ym5 /display "&yyyym5";

  define _&ym4 /display "&yyyym4";

  define _&ym3 /display "&yyyym3";

  define _&ym2 /display "&yyyym2";

  define _&ym1 /display "&yyyym1";

  define _&year /display "&yyyy";

  column shading;

  define shading /computed noprint '';

  compute shading;

  if schlrank in (1) and factype in (1) then do;

  call define (_ROW_ , 'STYLE', 'STYLE=[BACKGROUNDCOLOR=#006A4E COLOR=#FFFFFF FONTWEIGHT=BOLD]');

  end;

  if schlrank in (1) and factype gt 1 then do;

  call define (_ROW_ , 'STYLE', 'STYLE=[BACKGROUNDCOLOR=#BBC5AF COLOR=#000000 FONTWEIGHT=BOLD]');

  end;

  if schlrank gt 1 and factype in (1) then do;

  call define (_ROW_ , 'STYLE', 'STYLE=[BACKGROUNDCOLOR=#A8A8A8 COLOR=#000000 FONTWEIGHT=BOLD]');

  end;

  if schlrank gt 1 and divrank gt 1 and factype in (1) then do;

  call define (_ROW_ , 'STYLE', 'STYLE=[FONTWEIGHT=BOLD]');

  end;

  if schlrank gt 1 and divrank gt 1 and unitrank in (1) and factype in (1) then do;

  call define (_ROW_ , 'STYLE', 'STYLE=[BACKGROUNDCOLOR=#E6E6E6 COLOR=#000000 FONTWEIGHT=BOLD]');

  end;

  if schlrank gt 1 and divrank gt 1 and unitrank in (1) and factype gt 1 then do;

  call define (_ROW_ , 'STYLE', 'STYLE=[FONTWEIGHT=BOLD]');

  end;

  if factype in (2,6) then do;

  call define ("description" , 'STYLE', 'STYLE=[INDENT=2]');

  end;

  if factype in (3,4,5) then do;

  call define ("description" , 'STYLE', 'STYLE=[INDENT=4]');

  end;

  endcomp;

run;

ods tagsets.Excelxp close;

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  I do not believe that INDENT=  (or TEXTINDENT= ) is used by TAGSETS.EXCELXP since it is an XML-based destination. If you look in the doc, it says that for XML the default INDENT= is 2. I do not believe you can change this. But Tech Support would know the definitive answer.

   

cynthia


doc_indent_attribute.png
mtrapani
Calcite | Level 5

Hi Cynthia,

Just to follow up on this discussion, I did get in touch with SAS support.  There is an existing defect with tagsets.excelxp regarding the indents, which should be corrected in the next version of SAS.  In the meantime, I was given a workaround in the form of a new exceltags.tpl file and some code to insert before the ods statements:

ods path(prepend) work.templat(update);

%include "<file location of exceltags.tpl>";

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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