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...
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.
Hmm... That doesn't seem to be working. Is there a way to compress the size of the table directly?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.