BookmarkSubscribeRSS Feed
Daily1
Quartz | Level 8
proc template; 
define style styles.mystyle; 
    parent = Styles.Default; 
    style systemtitle /
        font_face = 'Calibri'      
        font_weight = bold
        font_size = 12pt
    ;   
    style systemfooter /
        font_face = 'Calibri'
        font_size = 8pt     
    ;
    style data /
        fontfamily = 'Calibri'
        font_size = 10pt
        foreground = black
    ;
    style header /
        fontfamily  = 'Calibri'
        font_size = 10pt
        foreground = Black
        background = white
    ;

    style summary /
        fontfamily  = 'Calibri'
        font_size = 10pt
        foreground = Black
        font_weight = bold 
        background = white 
    ;

    style table /
        cellpadding = 5px
        cellspacing = 0px
        borderwidth = 1px       
        bordercolor = black
        borderstyle = solid
    ;


end; 
run;
ods phtml file="report.rtf" style=mystyle    ;
title1 "A";
proc print data=sashelp.cars (obs=10);
run;
title1;
title2 "B";
proc print data=sashelp.cars(obs=10);
run;
ods _all_ close;

Daily1_0-1712223101571.png

How to remove Horizontal line ? 

 

4 REPLIES 4
ballardw
Super User

Is there some specific reason you are creating HTML, the basic output of the parent Styles.Default, to and RTF file?

 

Suggestion: get the code for Styles.default using proc template. Look at all the defined classes that you have not overridden

In the section for Class html you might find

      'PageBreakLine' =
      "<p style=""page-break-after: always;""><br/></p><hr size=""3""/>"
      'fake bullet' = %nrstr("<b>&#183;</b>");

Changing that to

      'PageBreakLine' =
      "<p style=""page-break-after: always;""><br/></p></>"
      'fake bullet' = %nrstr("<b>&#183;</b>")

will remove that line in this example. I don't know what it might break elsewhere.

 

BTW including ODS _ALL_ CLOSE; is sort of rude as that affects settings of others using your code. You should only close the specific ODS destination in question when discussing ODS options.

Ksharp
Super User

Try option "page_break=".

options orientation=landscape;
ods phtml file="c:\temp\report.rtf" style=journal  options(page_break='no')  ;
title1 "A";
proc print data=sashelp.cars (obs=10);
run;
title1;
title2 "B";
proc print data=sashelp.cars(obs=10);
run;
ods _all_ close;

Ksharp_0-1712298317978.png

 

Daily1
Quartz | Level 8
I have a customized font that I would like to use to create an RTF file containing multiple PROC REPORTs within a single report. Additionally, I want each report to start on a new page. I've found that ODS PHTML only works for customized fonts
ballardw
Super User

@Daily1 wrote:
I have a customized font that I would like to use to create an RTF file containing multiple PROC REPORTs within a single report. Additionally, I want each report to start on a new page. I've found that ODS PHTML only works for customized fonts

Have you made that Font available to SAS? Proc Fontreg is used to add fonts to the SAS registry to recognize such. Do read the documentation as to how the resulting fonts would need to be referenced in Proc Report (or other procedures) Style options.

 

Each report on a new page would be the ODS RTF option startpage=yes, which can be changed at different points in a document if you need to change the behavior temporarily for one long (or several very sort) procedure outputs.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2225 views
  • 0 likes
  • 3 in conversation