09-23-2011 09:25 AM
with PROC REPORT I create a label for a column: DEFINE PROD / GROUP LEFT ORDER=DATA "OFF BALANCE SHEET/Product"
WHen printing it to:
1/ ODS directed to HMTL: ok, "3 words" are on one line, next line "product"!
2/ ODS to PDF:
it stacks everything in 4 lines.
I tried, unsuccessfully, a lot of things
* length prod $20.
* in proc report: (DEFINE PROD / GROUP LEFT ORDER=DATA "OFF BALANCE SHEET/Product" width=20)
09-23-2011 09:37 AM
09-23-2011 09:37 AM
09-25-2011 02:54 PM
To elaborate a bit on Tim's posting, there are a number of PROC REPORT options (HEADLINE, HEADSKIP, SPACING, WIDTH, SKIP, DOL, DUL, OL, UL, PANELS, FLOW, etc,) that are LISTING only options -- they were designed to work in the LISTING destination and are basically ignored by the other ODS destinations. For more information, refer to:
HTML and PDF are inherently different destinations -- so you can never guarantee that the output will look EXACTLY the same in both destinations. For example, HTML is not bound by physical page restrictions, so an HTML report can be as wide or as long as it needs to be and the only controls you have for header/column width are the default slash (/) which indicates where a header string should break or the CELLWIDTH= or WIDTH= style attribute (not to be confused with the WIDTH= option that only impacts the LISTING destination).
On the other hand, PDF is bound by physical page restrictions, as it calculates column width based on a formula that takes all of the following into account: the orientation, the page margins and the size of the font and the cellpadding and cellspacing attributes. So, where a header string might take up only 1 line in HTML, that same string might take up multiple lines in the PDF destination. The use of the default slash (/) allows you to indicate an exact place in which a header string should break. If you run the program below, you will see that I have made the cells different widths (and used some differing justification), without the slash, the destinations use cellwidth to determine the overall look of the column headers. Note the appearance of the PT2 column for example -- it will wrap the header string differently in PDF versus HTML in the absence of any other instructions from me in the STYLE= statement overrides.
ods listing close;
options nodate nonumber center orientation=landscape;
ods html file='c:\temp\usecellwidth.html' style=sasweb;
ods pdf file='c:\temp\usecellwidth.pdf';
proc report data=sashelp.prdsale(obs=100)
column prodtype prodtype=pt2 product actual predict;
DEFINE PRODTYPE / GROUP "OFF BALANCE SHEET/Product Type"
DEFINE pt2 / GROUP "OFF BALANCE SHEET Product Type 2";
define product / group "OFF/BALANCE/SHEET/Product"
define actual / sum "OFF BALANCE SHEET Actual"
define predict / sum "OFF BALANCE SHEET Predict"
ods _all_ close;
Need further help from the community? Please ask a new question.