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
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.
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.
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.
Ods excel is newer, so might not fully support everything now, or in the version you are using.
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
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 🙂
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.