Using proc report and ODS Tagsets.RTF in Enterprise Guide:
Given a simple table such as :
Is it possible to generate headers to match the following:
Spanning Header 3 and Spanning Header 4 are straightforward.
Question1: is it possible to merge the headers of 2 columns (ID1 and ID2 as Identifiers above) into a single , regular header?
Question2: is it possible to merge spanning (and regular) headers vertically? As in the Identifiers and Value Headers above?
I have been unable to merge the header across 2 columns (as in ID1 and ID2).
But i have been able to get a slight approximation of the vertical spanning, by creating empty 'dummy headers' with the appropriate borders set the same shade as the background. But they are not actually spanning, and entering text in them is problematic.
its a small effort to adjust a table manually after its generated as an RTF File, but with many tables it is just a time sink. If there is anyway possible SAS is capable of doing either of these tasks, I would love to know how.
Thanks in advance.
Hi:
PROC REPORT is really geared to doing spanning headers horizontally. PROC REPORT writes only 1 report row at a time, so when it is writing the second header row, for spanning header 3, it does not have the ability to back and do vertical merging above ID1 and ID1 or vertical merging for VALUE.
However, although the Report Writing Interface might allow you to do the type of vertical merging you envision, that would be a whole new syntax AND the challenge with the Report Writing Interface is that it is only supported by PDF and HTML destinations right now.
Since you didn't post your code, I used some fake data and used this PROC REPORT to show the best that I think PROC REPORT can do for you compared to the Report Writing Interface (RWI):
The RWI allows you control the row spanning and the column spanning for report headers and for data cells, but if you must have RTF, then this may not be an option for you.
Cynthia
Hi:
PROC REPORT is really geared to doing spanning headers horizontally. PROC REPORT writes only 1 report row at a time, so when it is writing the second header row, for spanning header 3, it does not have the ability to back and do vertical merging above ID1 and ID1 or vertical merging for VALUE.
However, although the Report Writing Interface might allow you to do the type of vertical merging you envision, that would be a whole new syntax AND the challenge with the Report Writing Interface is that it is only supported by PDF and HTML destinations right now.
Since you didn't post your code, I used some fake data and used this PROC REPORT to show the best that I think PROC REPORT can do for you compared to the Report Writing Interface (RWI):
The RWI allows you control the row spanning and the column spanning for report headers and for data cells, but if you must have RTF, then this may not be an option for you.
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.