BookmarkSubscribeRSS Feed
jpoole412
Calcite | Level 5
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
1 REPLY 1
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 1753 views
  • 0 likes
  • 2 in conversation