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:
WITH the template style "calib" they look like this:
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:
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
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 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.
Hi:
So here's a default ODS PDF example using STARTPAGE=NO and you see the default space between the 2 tables:
However, switching to ODS LAYOUT and ODS REGION, you can control the space with the row_gutter option:
and by playing with row_gutter, you can reduce the space a bit:
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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: