Hello Experts,
Do you know please how to avoid this white gap in odsout obj():
My code is :
obj.table_start(name: "Table1_2",label: "Notre première table bis",overrides: "rules=none width=18cm frame=void");
obj.row_start();
obj.format_cell(text: "WORDS WORDS WORDS WORDS WORDS :", overrides: " backgroundcolor=cx338AFF just=left color=white font_size=10pt font_weight=bold cellheight=0.55cm cellwidth=15.5cm fontfamily=arial");
obj.format_cell(data: "NA", overrides: " backgroundcolor=cx338AFF color=white font_size=10pt font_weight=bold just=left cellheight=0.4cm cellwidth=1.5cm fontfamily=arial");
obj.row_end();
obj.table_end();
Thank you for your help !
Strong suggestion:
Provide a small data set (if your report uses one) and a complete data step that we can execute that duplicates the behavior you show.
Without data and complete code, or at least enough to generate some output it is extremely hard to determine what might be needed. It may be that white space is coming from something prior to the table.
In this case I would look at your WIDTH declarations. You have a table width of 18cm and cells of 15.5cm and 1.5cm, 15.5+1.5=17. So does the white space look to be about 1cm????
When you use explicit sizes it is up to you to ensure they make sense. I would likely use the CELL widths in percentages. That way if you change the table width the cells should adjust (though text may be cramped with other settings).
Thank you Ballard,
I don't have a specail data for this code, the percentage doesn't work. I still have the gap.
My code is :
options orientation=portrait;
OPTIONS TOPMARGIN=.001 in BOTTOMMARGIN=.001 in LEFTMARGIN=.001 in RIGHTMARGIN=.001 in;
ODS NORESULTS;
ODS PDF FILE = "&Publipostage.\TEST.pdf" dpi=1800 startpage=no;
data _NULL_;
declare odsout obj();
obj.layout_absolute(width:
"8.26 in",height:"11.68 in" );
obj.table_start(name: "Table1_2",label: "Notre première table bis",overrides: "rules=none width=18cm frame=void");
obj.row_start();
obj.format_cell(text: "WORDS WORDS WORDS WORDS WORD :", overrides: " backgroundcolor=cx338AFF just=left color=white font_size=10pt font_weight=bold cellheight=0.55cm cellwidth=80% fontfamily=arial");
obj.format_cell(data: "NA", overrides: " backgroundcolor=cx338AFF color=white font_size=10pt font_weight=bold just=left cellheight=0.55cm cellwidth=20% fontfamily=arial");
obj.row_end();
obj.table_end();
run;
Sorry, I was remembering something else that allowed percents. It appears that cellwidth doesn't.
But something else seems to be missing. I can't generate a PDF with that text on one row, which may be a version difference.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.