BookmarkSubscribeRSS Feed
_Manhattan
Quartz | Level 8

Hey guys,

 

quick question. I would like to customize my proc report tables that I print with ODS PDF:

1. I would like to use calibri as a font.

2. I would like to define the borderwidth of the table (or use a different approach to change the font family - see below).

3. I would like to shrink the space between two proc report tables.

 

For the First problem I have used proc template. Unfortunately, the table borders change with the defined style. The borders WITHOUT the template style "calib" look like this:

Bsp66.JPG

WITH the template style "calib" they look like this:

Bsp67.JPG

So either I would like to customize the borders OR use a different approach to change the font family. I do not need the bold borders.

 

Furthermore, for the third Problem I would like to shrink the marked space between the tables:

Bsp68.JPG

It is okay if there is still some space, but it should just not be as big.

 

My example code looks like this. The style command "borderbottomwidth" and "bordertopwidth" do not change anything. But thats what I have tried so far:

proc template; 
   define style Styles.calib; 
   parent=styles.printer;
   replace fonts / 
    'docFont' = ("Calibri",10pt);      
   end;
run;



ods pdf startpage=no;
options papersize=a4 printerpath=pdf  orientation=portrait leftmargin=1.5cm rightmargin=1.5cm topmargin=1.5cm bottommargin=1.5cm nodate nonumber;
ods listing close;
ods pdf file="yourpath\.pdf";
proc report data=sashelp.cars(obs=10) noheader style(report)={borderbottomwidth=0.1cm};
	columns make model type;
run;

proc report data=sashelp.baseball(obs=10) noheader style(report)={bordertopwidth=0.1cm};
	columns Name Team;
run;
ods pdf close;

Does anyone know how to handle these issues?

Kind regards

 

 

4 REPLIES 4
ballardw
Super User

Try adding the style elements to COLUMN and HEADER, and if you use any summarys the SUMMARY area:

proc report data=sashelp.cars (obs=10)
  style(column) = [fontfamily=calibri borderwidth=.01cm]
  style(header) = [fontfamily=calibri borderwidth=.01cm]
;
   columns make model type;
run;

it seems that at a certain point the destination you chose may not reduce the widths of borders.

 

 

_Manhattan
Quartz | Level 8
Thank you, that worked for me! 🙂 I do not mark it as a solution yet, as I am still struggling with the space between the proc reprort tables. Do you have any idea how to resolve that issue?
ballardw
Super User

@_Manhattan wrote:
Thank you, that worked for me! 🙂 I do not mark it as a solution yet, as I am still struggling with the space between the proc reprort tables. Do you have any idea how to resolve that issue?

It is not a Proc Report issue. It is ODS destination dependent. As far as I've found RTF is the only destination that specifically lists a parameter involved with space between tables. Either change / add a PARSKIP setting for RTF to a style or use ODS Tagsets.rtf that allows an ods option to set PARSKIP values.

 

Maybe @Cynthia_sas has an idea of space between tables in PDF.

Cynthia_sas
SAS Super FREQ

Hi:

  So here's a default ODS PDF example using STARTPAGE=NO and you see the default space between the 2 tables:

Cynthia_sas_0-1718984159932.png

However, switching to ODS LAYOUT and ODS REGION, you can control the space with the row_gutter option:

Cynthia_sas_1-1718984216153.png

and by playing with row_gutter, you can reduce the space a bit:

Cynthia_sas_2-1718984271809.png

You'll have to dig into the documentation on ODS LAYOUT and ODS REGION with ODS PDF to learn more details.

The issue of changing fonts, etc are all well documented in the SAS documentation and in postings here and in user group papers, so those should be easy to find. However, my advice is to pick what's most important, if getting the space reduced is most important, then do that first, without regard to fonts and border widths. Anything you do to change the font and/or size of the tables can impact what is "played" into each region with ODS LAYOUT.

  Cynthia

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 177 views
  • 3 likes
  • 3 in conversation