The SAS Output Delivery System and reporting techniques

PROC REPORT and ODS

Reply
N/A
Posts: 0

PROC REPORT and ODS

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.
SAS Employee
Posts: 22

Re: PROC REPORT and ODS

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;
N/A
Posts: 0

Re: PROC REPORT and ODS

> 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??
SAS Employee
Posts: 174

Re: PROC REPORT and ODS

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

-- David Kelley, SAS
SAS Employee
Posts: 22

Re: PROC REPORT and ODS

Try the following as an alternative:

column ("\brdrb\brdrs\brdrw15 Category A" col1 col2) col3 col4 col5;
N/A
Posts: 0

Re: PROC REPORT and ODS

> 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?
SAS Employee
Posts: 50

Re: PROC REPORT and ODS

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!
N/A
Posts: 0

Re: PROC REPORT and ODS

> 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.
SAS Employee
Posts: 50

Re: PROC REPORT and ODS

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);
Ask a Question
Discussion stats
  • 8 replies
  • 331 views
  • 0 likes
  • 4 in conversation