Trying to get new id from new page using proc report for EXCEL

Reply
New Contributor
Posts: 2

Trying to get new id from new page using proc report for EXCEL

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;                    

Super User
Super User
Posts: 9,193

Re: Trying to get new id from new page using proc report for EXCEL

Posted in reply to tanu_sharma

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.

Super User
Posts: 9,550

Re: Trying to get new id from new page using proc report for EXCEL

Posted in reply to tanu_sharma

Try

sheet_interval="bygroup"
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 2

Re: Trying to get new id from new page using proc report for EXCEL

Posted in reply to KurtBremser

Hey

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

Ask a Question
Discussion stats
  • 3 replies
  • 82 views
  • 2 likes
  • 3 in conversation