BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LawrenceHW
Quartz | Level 8

Hi all,

 

I need to indent the text on selected rows in a PROC REPORT that I'm sending to an excel workbook. I'd prefer to use ODS EXCEL as it's neater but I can't get the INDENT= option to work in the STYLE option.

 

In TAGSETS.EXCELXP the option works.

 

I've used code like this to indent a column based on the value of a variable:

compute an_label;
if row ge 2 then
call define('an_label', "style",
"style = {backgroundcolor = yellow indent=2}");
endcomp;

 

This works perfectly in the TAGSETS but only the background colour change works in ODS EXCEL.

 

Anyone got any ideas/experience with this?

 

Cheers,

Lawrence

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, don't know from experience on ods excel.  You could however try to put two spaces in your data, then use the asis=on part in your proc report:

column a / style={asis=on};

This will persist any leading spaces in a into any output.

View solution in original post

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, don't know from experience on ods excel.  You could however try to put two spaces in your data, then use the asis=on part in your proc report:

column a / style={asis=on};

This will persist any leading spaces in a into any output.

LawrenceHW
Quartz | Level 8

This worked (although I added it as a global option to the PROC REPORT):

 

proc report data=work.summary_data nowd missing
style(column) = [asis = on];

 

I do like the neatness of the INDENT option but it just doesn't seem to have been enabled.

 

Thanks for the swift reply.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Ods excel is newer, so might not fully support everything now, or in the version you are using.  

Cynthia_sas
SAS Super FREQ
Hi:
And as I remember, INDENT= was sort of fickle. I always used LEFTMARGIN= instead.
Cynthia
LawrenceHW
Quartz | Level 8

Hi Cynthia,

 

Thanks for the information. I've actually got the INDENT= option working now. It's something to do with the value. Originally I used INDENT=2 (as that was what had been used in a previous program for TAGSETS.EXCELXP) but using INDENT=20 got the indentation to appear where I want it to (I need to fully investigate exactly why but it could be something to do with the customised style I've used and what the INDENT value is specified in [twips,points, etc.]).

 

Cheers,

Lawrence

 

LawrenceHW
Quartz | Level 8

A quick update. The INDENT option was actually working but the values I was entering were not enough to show up. Following some correspondence with SAS Technical Help I've got it all sorted with ODS EXCEL.

 

By using INDENT=1cm I can indent text by 1 cm. It's all just a case of specifying a unit 🙂

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 2551 views
  • 0 likes
  • 3 in conversation