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?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 838 views
  • 0 likes
  • 2 in conversation