The SAS Output Delivery System and reporting techniques

Templates and Proc Report

Reply
N/A
Posts: 0

Templates and Proc Report

I want to put a thick border around my tables in Proc Report, output via ExcelXP but am having trouble applying it to my table.

I have set up a style in my template:

style rep_border from table / borderrightstyle=solid borderrightwidth=2 borderrightcolor=black
borderleftstyle=solid borderleftwidth=2 borderleftcolor=black
borderbottomstyle=solid borderbottomwidth=2 borderbottomcolor=black
bordertopstyle=solid bordertopwidth=2 bordertopcolor=black;


and am trying to apply it in Proc Report as an option on the proc report line using the following code:

style(report)=rep_border

I cannot find any documentation telling me if my options are correct. Any help would be appreciated. Thanks in advance.

Drew
SAS Super FREQ
Posts: 8,862

Re: Templates and Proc Report

Posted in reply to deleted_user
Hi:
You do seem to be using the correct reference method.

I wonder if this is one of those cases where if you sent your output to HTML, it would look as you expect; but Excel doesn't use the border style the same way that HTML does????

Perhaps you could try this:
[pre]
** style template code;

ods html file='ht_test.html' style=newstyle;
ods tagsets.excelxp file='xp_test.xml' style=newstyle;
** proc report code;
ods _all_ close;
[/pre]

If the HTML output looks as you expect, but the Excel does NOT look as you expect, then this is not an issue with PROC REPORT, it is an issue with Excel not rendering the table settings correctly, or else the table border settings are being overridded by the cell-level settings. This probably turns your question into a question for Tech Support, whether they know of a way to have the table borders set via a style template when using TAGSETS.EXCELXP.

cynthia
N/A
Posts: 0

Re: Templates and Proc Report

Posted in reply to deleted_user
Thanks Cynthia

I should probably explain further: I have used the following successfully to put a thick border around my headers.

style head_border from header / borderrightstyle=solid borderrightwidth=2 borderrightcolor=black
borderleftstyle=solid borderleftwidth=2 borderleftcolor=black
borderbottomstyle=solid borderbottomwidth=2 borderbottomcolor=black
bordertopstyle=solid bordertopwidth=2 bordertopcolor=black
just=c;


and then called it with this:
style(header)=head_border

which leads me to suspect that I am not using the correct references for the table/report either in the Template or the option in Proc Report.

Thanks.
SAS Super FREQ
Posts: 8,862

Re: Templates and Proc Report

Posted in reply to deleted_user
Hi:
I understand, however, Header borders are CELL-level borders. You are trying to change TABLE-level borders. Just because you can change CELL-level borders in the ExcelXP destination, does not mean that Excel will correctly render TABLE-level borders.

I think it's worthwhile to test whether ODS HTML respects your TABLE level borders as a problem-solving/debugging technique. If ODS HTML shows the TABLE-level borders, but Excel does not, then the problem is NOT with SAS or PROC REPORT. This is useful information.

For example, when I try this code which has RED TABLE-level borders and YELLOW CELL-level borders, I see RED and YELLOW in the HTML output, but I only see YELLOW in the ExcelXP output. This leads me to believe that the issue is with Excel. Sending the information via PROC REPORT overrides in this instance would be the same as sending style info to Excel via a style template.

I don't know whether there's a way to change TABLE-level borders in Excel. This may be a question for Tech Support.

cynthia
[pre]
ods html file='c:\temp\test_border.html' style=styles.sasweb;
ods tagsets.excelxp file='c:\temp\test_border.xml'
style=styles.sasweb;
proc report data=sashelp.class(obs=3) nowd
style(report)={borderrightstyle=solid borderrightwidth=5 borderrightcolor=red
borderleftstyle=solid borderleftwidth=5 borderleftcolor=red
borderbottomstyle=solid borderbottomwidth=5 borderbottomcolor=red
bordertopstyle=solid bordertopwidth=5 bordertopcolor=red}
style(header)={borderrightstyle=solid borderrightwidth=5 borderrightcolor=yellow
borderleftstyle=solid borderleftwidth=5 borderleftcolor=yellow
borderbottomstyle=solid borderbottomwidth=5 borderbottomcolor=yellow
bordertopstyle=solid bordertopwidth=5 bordertopcolor=yellow};
column name age height;
run;
ods _all_ close;

[/pre]
N/A
Posts: 0

Re: Templates and Proc Report

Posted in reply to deleted_user
Thanks Cynthia, Excel is a nightmare as ever... Message was edited by: ScoobyDrew
Ask a Question
Discussion stats
  • 4 replies
  • 157 views
  • 0 likes
  • 2 in conversation