BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am having trouble getting my output to look how I want it when using headers which span columns in PROC REPORT using ODS to RTF;
e.g.
PROC REPORT data=somedata;
columns ("Category A" col1 col2) col3 col4 col5;


In my style sheet I have:
style table from container /
frame = hsides

to give me a line at the top and bottom of the output, and a line underneath the header row.
I would also like a line underneath the spanning header title (i.e. a line under the "Category A" cell).
I would normally achieve this outside of ODS using:
OPTIONS formchar="__", and using "__Category A__" in the PROC REPORT call.

I am sure that what I require should be possible - however I do not know how to do it.
I would appreciate any help you can provide.

Many thanks.
8 REPLIES 8
Kathryn_SAS
SAS Employee
You can use in-line formatting to get the desired result in the header:

column ("\ul Category A" col1 col2) col3 col4 col5;

You will also need to add the following in your PROC TEMPLATE code:

style header from headersandfooters /
protectspecialchars=off;
deleted_user
Not applicable
> You can use in-line formatting to get the desired
> result in the header:
>
> column ("\ul Category A" col1 col2) col3 col4 col5;
>
> You will also need to add the following in your PROC
> TEMPLATE code:
>
> style header from headersandfooters /
> protectspecialchars=off;

This only applies an underline to the text itself, whereas I am after putting a line for the whole cell.

Help??
David_SAS
SAS Employee
Our RTF expert in R&D is away this week (SUGI). We should have an answer for you early next week.

-- David Kelley, SAS
Kathryn_SAS
SAS Employee
Try the following as an alternative:

column ("\brdrb\brdrs\brdrw15 Category A" col1 col2) col3 col4 col5;
deleted_user
Not applicable
> Try the following as an alternative:
>
> column ("\brdrb\brdrs\brdrw15 Category A" col1 col2)
> col3 col4 col5;



This seems to work quite nicely. Thank you.
Out of interest (and to save me from probably posting something else in the future), is there anything equivalent for PDF?
ScottH_SAS
SAS Employee
As far as underlining the text of a header there will be a new style function called "textdecoration" in 9.2 that will allowing underling, overlining, or line-through. After verifying with Tech Support I see that you are using RAW RTF commands. PDF can not support that. If you want to send me a snippet of code and output I would be glad to dig more into it for you. If you have some code please email it to ODS@sas.com. Thanks!
deleted_user
Not applicable
> As far as underlining the text of a header there will
> be a new style function called "textdecoration" in
> 9.2 that will allowing underling, overlining, or
> line-through. After verifying with Tech Support I
> see that you are using RAW RTF commands. PDF can not
> support that. If you want to send me a snippet of
> code and output I would be glad to dig more into it
> for you. If you have some code please email it to
> ODS@sas.com. Thanks!


I have just send you an e-mail to ods@sas.com.
Thanks.
ScottH_SAS
SAS Employee
Sorry I initially misunderstood the question and focused on underlining the text. After getting Michael's e-mail I got a better understanding of the problem he was describing.

I responded to Michael via e-mail but I wanted to update the Forum with my response.

Using border control I was able to set a border bottom margin under your title. I even changed the color to red to make it stand out. Now the catch, all this works in version 9.2. Currently PDF can't do it but it will in the next release.

The only change I made to your proc report code was using the new inline style elements on the column statement:

columns ("^{style [borderbottomwidth=1pt borderbottomcolor=red]Main Title}" col1 col2) ("Title 2" col3 col4);

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 1359 views
  • 0 likes
  • 4 in conversation