tagsets.rtf and ods text style background color (cell vs text)

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

tagsets.rtf and ods text style background color (cell vs text)

I'm having a bit of a problem with ods tagesets and the ods text styles. I've attached the code and output as well as how I'd like the output to look like for clarity.

Essentially, when I change the color of the text background, it will only highlight the background directly behind the text. What I'd like is for the entire table cell to have the background color rather than just what is behind the text.

In addition, the first line of my text is not centering like I specify. That is the next hurdle for me.

Any help would be greatly appreciated!

Attachment

Accepted Solutions
Solution
‎01-15-2015 09:33 AM
New Contributor
Posts: 4

Re: tagsets.rtf and ods text style background color (cell vs text)

Posted in reply to Cynthia_sas

Thanks Cynthia


I was able to work on it more and actually was able to get the result I wanted, but instead of using mostly RTF escape characters, I created a style and applied that type to where I needed it. I wasn't using titles because it was not associated with specific output. The text allowed me to insert text that was not associated with specific procedures for this report.

I've attached the sas file for reference. For some reason I can't copy and paste my code...

View solution in original post

Attachment

All Replies
Super User
Posts: 11,343

Re: tagsets.rtf and ods text style background color (cell vs text)

I couldn't see any difference in the output pdfs.

I believe you are setting text characteristics not table cell, partially because of use of tables_off='usertext'. If you don't want a border you can try setting the border colors to your background color but no promises as the style NEWSTYLE looks likely not to be a SAS supplied style.

If possible, with RTF output post RTF files as PDF may change things and definitely won't allow examining RFT codes in the document.

New Contributor
Posts: 4

Re: tagsets.rtf and ods text style background color (cell vs text)

Thanks for the reply.

So is there a way in the ods text statement to specify the table cell properties rather than text properties? How would you do this?

SAS Super FREQ
Posts: 8,868

Re: tagsets.rtf and ods text style background color (cell vs text)

Hi:

  To change the table cell properties, you have to put the text into a table. But you are turning the table off for the User Text written by ODS TEXT -- so I don't know whether there's even a container involved anymore. I think that the UserText style element inherits from either NOTE or NoteContainer. But the issue is that if you change Note or NoteContainer to have the gold background, then it will be gold for all the text you write with ODS TEXT, not just the first line.
     

  So I guess you don't want to use a TITLE statement? I can come close to what you want using TITLE controls.

Cynthia


ods tagsets.rtf file="c:\temp\test_title.doc" startpage=no ;

options nobyline ;

ods escapechar='^';
options nobyline topmargin=0in bottommargin=0in leftmargin=0.5in;

title j=c "^{style[background=#C4BC96 fontstyle=roman ]Centered text with colored cell background}";
title2 j=l "^{style[fontweight=BOLD background=#BFBFBF fontstyle=roman]Text with bold shaded background}";
title3 j=l "^{style[fontweight=BOLD background=#FFFFFF fontstyle=roman ]Bolded text}";


proc print data=sashelp.class (obs=1);
run;

ods _all_ close;


using_title_statement.png
Solution
‎01-15-2015 09:33 AM
New Contributor
Posts: 4

Re: tagsets.rtf and ods text style background color (cell vs text)

Posted in reply to Cynthia_sas

Thanks Cynthia


I was able to work on it more and actually was able to get the result I wanted, but instead of using mostly RTF escape characters, I created a style and applied that type to where I needed it. I wasn't using titles because it was not associated with specific output. The text allowed me to insert text that was not associated with specific procedures for this report.

I've attached the sas file for reference. For some reason I can't copy and paste my code...

Attachment
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 741 views
  • 3 likes
  • 3 in conversation