Desktop productivity for business analysts and programmers

Proc report column headers spanning

Reply
Occasional Contributor
Posts: 6

Proc report column headers spanning

I using tagsets.excelxp to output the result of a proc report to Excel. In this proc report I have 5 columns with a spanned header over the 2 right columns. When I output this to Excel the 3 left most column are spanned by a blank column header. I'd like to remove this column header and not have a spanned header over the 3 left-most columns. (i.e. in Excel the column headers take up 2 rows...first row is for spanned headers and the 2nd is for the regular column headers, I would like the 3 columns that do not have a spanned header to be a "merged" cell of the first two rows). I honestly have no idea where to even start to try and accomplish this.

Thanks for any possible help,

Jeff
SAS Super FREQ
Posts: 8,819

Re: Proc report column headers spanning

Hi:
PROC REPORT wants to have the same number of columns on every row -- so, if you have a spanned header above only 2 variables (in a list of 5, there will be empty cells above the other 3 variables). So, for example:
[pre]
column name age sex ('Spanning' height weight);
[/pre]

The string "Spanning" will be above the column headers for height and weight and there will be empty cells above the columns for name, age and sex. You might try this:
[pre]
column (' ' name age sex) ('Spanning' height weight);
[/pre]

...but I am not on a machine where I can test now and I don't remember whether you can have spaces span the headers for NAME, AGE and SEX -- I think you can, but it's an easy enough approach to test and see what happens.

Otherwise, it sounds like the BOX area in PROC TABULATE does more what you want, because by default, it spans (or looks like merged cells) above the row header area. Without seeing your REPORT code, I don't know whether you have a detail report or a summary report, so I can't say whether TABULATE is a viable alternative in this situation. Can you post some of the code that you've tried??? Perhaps using SASHELP.CLASS for illustration purposes.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 675 views
  • 0 likes
  • 2 in conversation