BookmarkSubscribeRSS Feed
KevinViel
Pyrite | Level 9

I am presenting an abbreviation version of a STYLE (Template) that I wrote along with a REPORT procedure:

 

ods path ( prepend )
         work.templat
         ( write )
         ;

proc template ;
  define style
         styles.fpt
       / store  = work.templat
         ;

   parent = styles.pearl ;

   style table
       / frame             = hsides
         rules             = groups
         cellpadding       = 3pt
         cellspacing       = 0pt
/*         width             = 100%*/
         borderwidth       = 2
         font              = fonts( "docFont" )
         ;

  end ;

run ;

/***********************/
options orientation             = landscape
        topmargin               = 0.75in
        bottommargin            = 0.75in
        rightmargin             = 0.75in
        leftmargin              = 0.75in
        ;

ods pdf
    file      = "C:\Users\&sysuserid.\Documents\My SAS Files\fpt2.pdf"
/*    style = styles.fda_rtf_tfl*/
    style     = styles.fpt
    startpage = never
    ;

title "With style( report ) = { width = 100% }" ;
proc report
   data  = sashelp.class
             ( obs = 5 )
   split = "~"
   missing
   style( report ) = { width             = 100% }
   ;

  column ( "`S={ borderbottomcolor = black
                 borderbottomwidth = 1pt
                 borderleftstyle   = none
                 borderrightstyle  = none
               }Group 1"
           name
         )
         ( "`S={ borderbottomcolor = black
                 borderbottomwidth = 1pt
                 borderleftstyle   = none
                 borderrightstyle  = none
               }Group 2"
           age
         )
         ( "`S={ borderbottomcolor = black
                 borderbottomwidth = 1pt
                 borderleftstyle   = none
                 borderrightstyle  = none
               }Group 3"
           sex
         )
         ;

  define name
       / "Name"
         style( column ) = [ cellwidth = 30% ] /* 30 */
         ;

  define age
       / "Age (Years)"
         style( column ) = [ cellwidth = 25% ] /* 55 */
         display
         ;

  define sex
       / "Sex"
         style( column ) = [ cellwidth = 25% ] /* 80 */
         ;

run ;

ods pdf close ;

In this test template, I commented out the WIDTH option, but I applied it in the REPORT statement.  I then ran the same code again with the STYLE( COLUMN ) option commented out.   I arrive at the following pdf:

fpt.jpg

How can I eliminate the space (breaks) in the lines?  Another issue is that using the inline style for the header over groups of columns is that the underlines of adjacent headers touch.  One program created an empty column via a dummy variable of one blank space.  We are not experience such issues in RTF output, so we may just start converting them and I have started learning the ODS DOCUMENT destination and the DOCUMENT procedure, but the style will still be an issue.

 

Our ultimate client is the FDA and other RAs.

 

Thank you,

 

Kevin

1 REPLY 1
Ksharp
Super User

Adding this line " style(header) = { cellspacing=0 } " in your code.

 

ods pdf
    file      = "C:\temp\fpt2.pdf"
/*    style = styles.fda_rtf_tfl*/
    style     = styles.fpt
    startpage = never
    ;
ods escapechar='`'; /*<------------*/
title "With style( report ) = { width = 100% }" ;
proc report
   data  = sashelp.class
             ( obs = 5 )
   split = "~"
   missing
   style( report column header) = { outputwidth = 100%    
    style(header) = {  cellspacing=0 }     /*<------------*/
   ;

  column ( "`S={ borderbottomcolor = black
                 borderbottomwidth = 1pt
                 borderleftstyle   = none
                 borderrightstyle  = none
               }Group 1"
           name
         )
         ( "`S={ borderbottomcolor = black
                 borderbottomwidth = 1pt
                 borderleftstyle   = none
                 borderrightstyle  = none
               }Group 2"
           age
         )
         ( "`S={ borderbottomcolor = black
                 borderbottomwidth = 1pt
                 borderleftstyle   = none
                 borderrightstyle  = none
               }Group 3"
           sex
         )
         ;

  define name
       / "Name"
         style( column ) = [ cellwidth = 30% ]  /*30 */  
         ;

  define age
       / "Age (Years)"
         style( column ) = [ cellwidth = 25% ] /* 55 */
         display
         ;

  define sex
       / "Sex"
          style( column ) = [ cellwidth = 25% ] /*80 */
         ;

run ;

ods pdf close ;

Ksharp_0-1670499792635.png

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 530 views
  • 0 likes
  • 2 in conversation