BookmarkSubscribeRSS Feed
SASdevAnneMarie
Barite | Level 11

Hello Experts,

 

Do you know please how to avoid this white gap in odsout obj():

 

SASdevAnneMarie_0-1650465671189.png

 

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 !

 

3 REPLIES 3
ballardw
Super User

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).

SASdevAnneMarie
Barite | Level 11

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;
ballardw
Super User

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: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 453 views
  • 0 likes
  • 2 in conversation