BookmarkSubscribeRSS Feed
tanu_sharma
Calcite | Level 5

I am trying to post new observation from new page in Excel sheet using proc report but BREAK does not seem to work here.

I have attached the report that I am receiving right now. The highlighted ID and the following details, need to start from new page.

Can someone please help me here. SAS Version 9

 

My code -

ODS TAGSETS.EXCELXP                                     
   FILE = REPORT2                                      
   RS=NONE                                              
   OPTIONS                                              
   (                                                    
    ABSOLUTE_COLUMN_WIDTH= "30,30"                      
    ROW_HEIGHTS          = '0,0,10,0,0,0,0'             
    ORIENTATION          = 'LANDSCAPE'                  
    ZOOM                 = '100'                        
    EMBEDDED_TITLES      = 'YES'                        
    EMBEDDED_FOOTNOTES   = 'YES'                        
    MISSING_ALIGN        = 'CENTER'                     
    SHEET_NAME           = 'Participant Basic Info'     
    SHEET_INTERVAL       = 'PROC'                       
   );                                                   
                                                        
TITLE1 justify=c &T1;                                   
TITLE2 justify=c &T2;                                   
                                                                     
PROC REPORT DATA = AU MISSING SPLIT='*'                              
 STYLE(HEADER)={BACKGROUND=BLUE COLOR=WHITE FONT_WEIGHT=BOLD         
                BORDERWIDTH=2 BORDERCOLOR=BLACK BORDERSTYLE=SOLID}   
 STYLE(COLUMN)={BACKGROUND=WHITE COLOR=BLACK FONT_WEIGHT=BOLD        
                BORDERWIDTH=2 BORDERCOLOR=BLACK BORDERSTYLE=SOLID};  
    BY                                                               
       ID                                                          
       ;                                                             
    COLUMN                                                           
         ID                                                       
         ITEM                                                        
         VALUE                                                       
         ;                                                           
                                                                     
    DEFINE ID / GROUP  NOPRINT style={just=center};                 
DEFINE ITEM  / ORDER=DATA 'Field Description' style={just=center      
                          };                                
DEFINE VALUE / ORDER=DATA 'Field Value' style={just=center  
                                          tagattr='wrap:yes'
                                     };                     
LABEL ID = 'Participant ID';
    BREAK AFTER ID/PAGE;        
                                 
RUN;                             
                                 
ODS TAGSETS.EXCELXP CLOSE;       
                                 
ODS LISTING;                    

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Excel does not have the concept of pages other than in the Print Preview setting.  In the lower right corner of Excel you will find some buttons, one is Normal - default view, the next is Page Layout - this will show you a paged representation as it would appear if you printed it.  To be honest I have no idea if you can control print preview options from SAS in this way, nor will Excel normally do this for you.  If you want nice printed output or paged output use an output destination appropriate to the task, e.g. rtf or pdf.  Excel is a spreadsheet not a word processor.

tanu_sharma
Calcite | Level 5

Hey

Thanks for the reply. Tried using it but didn't work.

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
  • 3 replies
  • 459 views
  • 2 likes
  • 3 in conversation