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?
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.