BookmarkSubscribeRSS Feed
yus03590
Calcite | Level 5

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...
2 REPLIES 2
ballardw
Super User

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.

yus03590
Calcite | Level 5

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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 944 views
  • 0 likes
  • 2 in conversation