The SAS Output Delivery System and reporting techniques

Indention with the odsout.format_cell() method in SAS 9.1.3

Reply
N/A
Posts: 0

Indention with the odsout.format_cell() method in SAS 9.1.3

How do you add a few spaces at the beginning of a new line with the format_cell() method of the ODSOUT object. A test program
/*
options nodate;
title1;
ods escapechar = '^';
ods listing close;
ods pdf file='test.pdf';
data _null_;
declare odsout obj();
obj.table_start(overrides: "cellspacing=0 cellpadding=0 frame=void rules=none");
obj.row_start();
obj.format_cell(text:"Joe Doe", overrides: 'just=left font_size=16pt');
obj.row_end();
obj.row_start();
obj.format_cell(text:"890 Cherry Rd SW ^n ^{nbspace 4}APT 10", overrides: 'just=left font_size=16pt');
obj.row_end();
obj.row_start();
obj.format_cell(text:"Tuscon, AZ", overrides: 'just=left font_size=16pt');
obj.row_end();
obj.table_end();
obj.delete();
stop;
run;
ods pdf close;
ods listing;
*/
Unlike V9.2, the ^{nbspace} or ^_ directive won't work with PDF or RTF destination, but it works partially for HTML destination, for example
options nodate;
/*
title1;
ods escapechar = '^';
ods listing close;
ods html file='test.html';
data _null_;
declare odsout obj();
obj.table_start(overrides: "cellspacing=0 cellpadding=0 frame=void rules=none");
obj.row_start();
obj.format_cell(text:"Joe Doe", overrides: 'just=left font_size=16pt');
obj.row_end();
obj.row_start();
obj.format_cell(text:"890 Cherry Rd SW ^n ^{nbspace}^{nbspace}^{nbspace}^{nbspace}APT 10", overrides: 'just=left font_size=16pt');
obj.row_end();
obj.row_start();
obj.format_cell(text:"Tuscon, AZ", overrides: 'just=left font_size=16pt');
obj.row_end();
obj.table_end();
obj.delete();
stop;
run;
ods html close;
ods listing;
*/
Suggestions? Thanks!

It seems that ^S={asis on} will preserve the leading blanks. Please delete this post!
Ask a Question
Discussion stats
  • 0 replies
  • 160 views
  • 0 likes
  • 1 in conversation