The SAS Output Delivery System and reporting techniques

ODS header issue with column width

Reply
Frequent Contributor
Posts: 131

ODS header issue with column width

ods listing close;

options missing=' ' topmargin=0.30in bottommargin=0.01in rightmargin=0.25in leftmargin=0.25in;

 

ODS TAGSETS.ExcelXP file="&ReportOut..xml" Path="&OutDir" style=&dors_style;

 

 

%macro Final(final,sheet_nm);                 

          

 

ODS TAGSETs.ExcelXP

options(sheet_interval= 'None'

        sheet_name= &sheet_nm.

        Orientation= 'landscape'

        Frozen_Headers = '1'

        EMBEDDED_TITLES = "YES"

        EMBEDDED_FOOTNOTES = "YES"

        GRIDLINES ="YES"

        AutoFit_Height = "YES"

        absolute_column_width="YES");     

                    

%NoAccountLogic(&final.,&ReportName);               

           PROC REPORT DATA=&final. headskip split='*' wrap nowd     

                    

           style(report)=[background=black cellspacing=10 just=center font_size=11pt font_face="Calibri" bordercolor=black borderwidth=1]       

           style(column)=[background=white font_size=10pt bordercolor=black borderwidth=1]      

          

           ;         

 

         

 COLUMNS _all_;     

                DEFINE SERVICER_CLIENT_CODE /Display style(column)={tagattr="format:0000000000" cellwidth=180pt just=LEFT} ;   

                DEFINE  SERVICER_LOAN_NUMBER /  Display style(column)={tagattr="format:0000000000" cellwidth=180pt just=left} ;

 

 

 In this code snippet notice I define the cell width.  I have adjusted the size to account for the headers.  Is there a way to have each header automatically wrap after each_  In orther words SERVICER_CLIENT_CODE becomes SERVICER_

                                                                                                                                                      CLIENT_

                                                                                                                                                      CODE_

Alternately is there a way to dynamically structure the headers so that parts of the word do not cut off and move to the next line.  I think the presence of the _  may be the cause.  I do not have the issue when I eliminate the _

 

 

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: ODS header issue with column width

Why do you want column name as the label?  Is this a data transfer, if so I would strongly advise to use something other than Excel.

As for your question, you can use the split=character option and specify a label:

define servicer_client_code / "SERVICER_*CLIENT_*CODE"...;

Grand Advisor
Posts: 10,204

Re: ODS header issue with column width

Another approach would be to use Labels without the _ in them

 

label SERVICER_CLIENT_CODE = "SERVICER CLIENT CODE";

Most of the procedures such as Report will attemp to use a label if in exists and if the space is limited will attempt to fit by breaking at spaces. Since this is a report then you will get "prettier" output.

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