BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
formerRuser
Fluorite | Level 6

Hello community,

 

When I run the following code with the style body from body statement (inserting a background image), it puts borders around my paragraph ods text. I do not want borders around any text. I've tried putting borderstyle=hidden, borderwidth=0pt, bordercolor=white, etc. into the body statement and into the paragraph style statement to no avail. I tried the style usertext from usertext approach to removing borders with no avail. Yet, when you run the following code without the style body from body statement, there are no borders on the odstext. Why is this happening, and how can I simultaneously have no borders around text and still have a background image?

 

ods _all_ close;
ods noresults;
ods escapechar="^";
Options orientation=portrait	
	papersize=letter
	nodate nonumber
	topmargin = 0.25in
	bottommargin = 0.25in
	leftmargin = 0.25in
	rightmargin = 0.25in;


proc template;
	define style Styles.mystyle;
	parent = Styles.Pearl;

	/* Adding a background image keeps adding borders to the paragraph ods text? */
	style body from body /
			backgroundimage="C:\...\.png?height=3cm";
       /* But if you comment out the above code, the borders go away */

	style myheader /
		foreground=red fontsize=14pt fontweight=bold fontfamily="Calibri";
	style myparagraph /
		foreground=black fontsize=12pt fontfamily="Times Roman";
	end;
run;


ods pdf file="C\...\testpdf.pdf"
	accessible
	style=Styles.mystyle;
	ods layout absolute;
		ods region y=1in;
		proc odstext;
			H "My Header Here" /
				style=myheader;
		run;
		proc odstext;
			P "My paragraph here" /
				style=myparagraph;
		run;
	ods layout end;
ods pdf close;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  This worked for me:

change_cellspacing.png

 

  I changed from STYLE with a FROM to CLASS for everything. If a style element does not exist with the name you pick, then CLASS makes it. You didn't really need style body from body -- so I changed that to CLASS too because if a style element does exist, then CLASS implies a FROM for the same named element.

 

  I always use an ODS PATH statement, so I added that, you may always plan to run the template "in-stream" in which case, it will be added to sasuser.templat...but I prefer to put my test templates in WORK.

 

  Finally, cellspacing=0 is one quick way to remove borders because it tells ODS to format the cell walls around your cell (in this case, your paragraph text) with a spacing value of 0, which generally is one way to get rid of the borders. It is simpler, in this case, with a new style element, which must have inherited from a style element with the default cellspacing of 7.

 

Hope this helps,

Cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  This worked for me:

change_cellspacing.png

 

  I changed from STYLE with a FROM to CLASS for everything. If a style element does not exist with the name you pick, then CLASS makes it. You didn't really need style body from body -- so I changed that to CLASS too because if a style element does exist, then CLASS implies a FROM for the same named element.

 

  I always use an ODS PATH statement, so I added that, you may always plan to run the template "in-stream" in which case, it will be added to sasuser.templat...but I prefer to put my test templates in WORK.

 

  Finally, cellspacing=0 is one quick way to remove borders because it tells ODS to format the cell walls around your cell (in this case, your paragraph text) with a spacing value of 0, which generally is one way to get rid of the borders. It is simpler, in this case, with a new style element, which must have inherited from a style element with the default cellspacing of 7.

 

Hope this helps,

Cynthia

formerRuser
Fluorite | Level 6

Thank you, Cynthia! This solved my problem.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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