Preventing Line Wrapping in Report Writing Interface

Reply
Occasional Contributor
Posts: 13

Preventing Line Wrapping in Report Writing Interface

Hi, so I am producing a report with report writing interface.  The report is divided into sub regions, with tables in each.  Unfortunately, occasionally a string in a cell is too long and this causes line wrapping, making the table to large for the region, which causes the table to be omitted from the report.  Is there a table argument to prevent wrapping and simply truncate the max length for each cell?  

 

I'm using SAS 9.4.

 

Here's some sample code:

 

		obj.table_start();
			obj.body_start();
				obj.row_start();
					obj.format_cell(data: "Parent Unit:", just: 'R', inhibit: 'TBLR', overrides: "font_weight=bold font_size=10pt");
					obj.format_cell(data: catx(' ', UNIT_NM_P, UNIT_TYPE_P), just: 'L', inhibit: 'TBLR', overrides: "font_size=10pt");
				obj.row_end();
				obj.row_start();
					obj.format_cell(data: "Unit Leader:", just: 'R', inhibit: 'TBLR', overrides: "font_weight=bold font_size=10pt");
					obj.format_cell(data: catx(' ', LEADER_TITLE_P, LEADER_FULL_NM_P), just: 'L', inhibit: 'TBLR', overrides: "font_size=10pt");
				obj.row_end();
				obj.row_start();
					obj.format_cell(data: "Home Phone:", just: 'R', inhibit: 'TBLR', overrides: "font_weight=bold font_size=10pt");
					obj.format_cell(data: catx(' ', LEADER_MOBILE_PHONE_COUNTRY_CD_P, LEADER_MOBILE_PHONE_NUMBER_P), just: 'L', inhibit: 'TBLR', overrides: "font_size=10pt");
				obj.row_end();
				obj.row_start();
					obj.format_cell(data: "Work Phone:", just: 'R', inhibit: 'TBLR', overrides: "font_weight=bold font_size=10pt");
					obj.format_cell(data: catx(' ', OFFICE_PHONE_COUNTRY_CD_P, LEADER_MOBILE_PHONE_NUMBER_P), just: 'L', inhibit: 'TBLR', overrides: "font_size=10pt");
				obj.row_end();
				obj.row_start();
					obj.format_cell(data: "Address:", just: 'R', inhibit: 'TBLR', overrides: "font_weight=bold font_size=10pt");
					obj.format_cell(data: HOME_ADDRESS_1_P, just: 'L', inhibit: 'TBLR', overrides: "font_size=10pt");
				obj.row_end();

...more lines...
Super User
Posts: 13,358

Re: Preventing Line Wrapping in Report Writing Interface

Simplest would probably be to assign a format to the offending variable(s) that will fit into the desired space.

 

adding

Format: "$15." to the obj_format_cell code should limit the displayed text to 15 characters.

Occasional Contributor
Posts: 13

Re: Preventing Line Wrapping in Report Writing Interface

[ Edited ]

Hmm... That doesn't seem to be working. Is there a way to compress the size of the table directly?

Ask a Question
Discussion stats
  • 2 replies
  • 103 views
  • 0 likes
  • 2 in conversation