Hi,
How do I indent a row in SAS RWI? the indent= ot textindent= options do not seem to work.
Thank you,
Neha.
Hi:
Leftmargin and rightmargin worked for me as style attribute overrides instead of trying indent=. Here's my output showing both the left margin and the right margin "indented" on selected rows, using conditional logic in the program:
And this is the program that created it.
options nodate nonumber;
ods pdf file="c:\temp\leftmargin_rightmargin_rwi.pdf" notoc ;
title '1) Use LeftMargin and RightMargin attributes';
data _null_;
set SASHELP.IRIS(obs=10) end=last;
if _N_ = 1 then do;
dcl odsout obj();
obj.table_start();
obj.head_start();
** Header row 1;
obj.row_start(type: "Header");
obj.format_cell(text: "Species",
style_attr:"fontweight=bold just=l width=2in leftmargin=.25in");
obj.format_cell(text: "SepalLength",
style_attr:"just=r fontweight=bold width=2in");
obj.row_end();
obj.head_end();
end;
** row for every obs;
** make every other row look "indented" by changing cell margin;
obj.row_start();
if _n_ in (1,3,5,7,9) then do;
obj.format_cell(data: species, style_attr:"just=l leftmargin=0in");
obj.format_cell(data: SepalLength, style_attr:"just=r rightmargin=0in");
end;
else do;
obj.format_cell(data: species, style_attr:"just=l leftmargin=.5in");
obj.format_cell(data: SepalLength, style_attr:"just=r rightmargin=.5in");
end;
obj.row_end();
if last then do;
obj.table_end();
end;
run;
ods pdf close;
My memory ( which may be faulty) was that INDENT= was originally designed for RTF, but I always thought that leftmargin= worked better as an override.
cynthia
RWI is what?
Provide more of an example of what you are doing. If you are using a procedure to generate output some of the options only work for the tradional Listing output not in ODS (Html, RTF, PDF etc).
Hi:
Leftmargin and rightmargin worked for me as style attribute overrides instead of trying indent=. Here's my output showing both the left margin and the right margin "indented" on selected rows, using conditional logic in the program:
And this is the program that created it.
options nodate nonumber;
ods pdf file="c:\temp\leftmargin_rightmargin_rwi.pdf" notoc ;
title '1) Use LeftMargin and RightMargin attributes';
data _null_;
set SASHELP.IRIS(obs=10) end=last;
if _N_ = 1 then do;
dcl odsout obj();
obj.table_start();
obj.head_start();
** Header row 1;
obj.row_start(type: "Header");
obj.format_cell(text: "Species",
style_attr:"fontweight=bold just=l width=2in leftmargin=.25in");
obj.format_cell(text: "SepalLength",
style_attr:"just=r fontweight=bold width=2in");
obj.row_end();
obj.head_end();
end;
** row for every obs;
** make every other row look "indented" by changing cell margin;
obj.row_start();
if _n_ in (1,3,5,7,9) then do;
obj.format_cell(data: species, style_attr:"just=l leftmargin=0in");
obj.format_cell(data: SepalLength, style_attr:"just=r rightmargin=0in");
end;
else do;
obj.format_cell(data: species, style_attr:"just=l leftmargin=.5in");
obj.format_cell(data: SepalLength, style_attr:"just=r rightmargin=.5in");
end;
obj.row_end();
if last then do;
obj.table_end();
end;
run;
ods pdf close;
My memory ( which may be faulty) was that INDENT= was originally designed for RTF, but I always thought that leftmargin= worked better as an override.
cynthia
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.
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.