Hi,
I am using proc report to create a report, however I would like to merge the cells defined as group at the summary line.
Is it possible to do this using the proc report or the htmlstyle (colspan=) in style of group vars ?
Current rept -
expected -
Code -
PROC SQL;
CREATE TABLE WORK.QUERY_FOR_PRDSALE AS
SELECT t1.COUNTRY,
t1.PRODTYPE,
t1.MONTH,
(SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 AS ACTUAL
FROM SASHELP.PRDSALE t1
WHERE t1.YEAR = 1994
GROUP BY t1.COUNTRY, t1.PRODTYPE, t1.MONTH ;
QUIT;
proc report data=WORK.QUERY_FOR_PRDSALE nowd
style(summary)=Header
;
title '3c) PROC REPORT';
*column ('Study' study) ('Category' category) datetime,value ('Total' value=tot);
column ('PRODTYPE' PRODTYPE) ('COUNTRY' COUNTRY) MONTH, ACTUAL ('ACTUAL' ACTUAL=tot);
define PRODTYPE / group style(column)=Header ' ' ;
define COUNTRy / group /*style(column)=Header */' ';
define MONTH /across order=internal f=date7. 'Date';
define ACTUAL / analysis sum f=comma6. ' ';
define tot / analysis sum ' ' f=comma6. ;
rbreak before/ summarize;
compute before ;
PRODTYPE = 'TOTAL' / ;
endcomp;
run;
Hi:
You cannot "merge" the cells. Whether HTMLSTYLE will work depends on the destination. You may or may not be able to change the style of just those lines, but again, depends on the version of SAS you're using and on your destination of choice.
cynthia
Merge cells or just remove the column border?
Hi Ballardw,
I was trying to merge cells here. I guess the border can be removed using htmlstyle= option within the style.
Hi:
You cannot "merge" the cells. Whether HTMLSTYLE will work depends on the destination. You may or may not be able to change the style of just those lines, but again, depends on the version of SAS you're using and on your destination of choice.
cynthia
Thanks Cynthia,
I mostly work on SAS addin SP reports using HTML..
I saw the merge happen in one report. But that was using PROC TABULATE. I hate to use PROC Tabulate so was wondering if that could be done in proc report.
I was under the impression that since an HTML file is created and then read into excel we could do something.
Never mind.
Thanks Cynthia and Ballardw.
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.