The SAS Output Delivery System and reporting techniques

Proc Report merge cells of summary line.

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

Proc Report merge cells of summary line.

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 -

1.JPG

expected -

2.JPG

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;


Accepted Solutions
Solution
‎08-18-2014 05:28 PM
SAS Super FREQ
Posts: 8,645

Re: Proc Report merge cells of summary line.

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

View solution in original post


All Replies
Grand Advisor
Posts: 9,748

Re: Proc Report merge cells of summary line.

Merge cells or just remove the column border?

Contributor
Posts: 31

Re: Proc Report merge cells of summary line.

Hi  Ballardw,

I was trying to merge cells here. I guess the border can be removed using htmlstyle=  option within the style.

Solution
‎08-18-2014 05:28 PM
SAS Super FREQ
Posts: 8,645

Re: Proc Report merge cells of summary line.

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

Contributor
Posts: 31

Re: Proc Report merge cells of summary line.

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.

Post a Question
Discussion Stats
  • 4 replies
  • 966 views
  • 0 likes
  • 3 in conversation