BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Smijoss
Fluorite | Level 6

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

4 REPLIES 4
ballardw
Super User

Merge cells or just remove the column border?

Smijoss
Fluorite | Level 6

Hi  Ballardw,

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

Cynthia_sas
SAS Super FREQ

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

Smijoss
Fluorite | Level 6

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

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
  • 4 replies
  • 2492 views
  • 0 likes
  • 3 in conversation