January 07, 2009, 11:39 AM
ok_dhscolumn width in PDF reports
I have been trying to align the heading items with title (please see the sample code) but depending on the
Data value in column; width either increases or decreases and it sets the alignment off. Is there a way to control this feature in a PDF report? Something where I could use the column number (N1, N2 etc) and set the width to a fixed size regardless of what’s in there?
Also, is there a way to set GRID around line 2 & 3 in TABHEADING?
I found out some info on this forum to control the size of column in a PDF file (for example LEFTGAP, BOTTOMGAP, RIGHTGAP, and TOPGAP etc) but that does not help with setting it to a fixed size. Also, some of the posts point out that the width of a column is controlled by the title. That does not seem to be case here.
In the sample, all titles are aligned with the heading items. If you change the country from England to France, the data will change and it sets the alignment off.
-* File test_fex.
TABLE FILE CAR
PRINT
DEALER_COST AS 'TITLE 4'
RETAIL_COST AS 'TITLE 5'
SALES AS 'T-6'
MODEL AS 'TITLE 7'
BY COUNTRY AS 'TITLE 1'
BY CAR AS 'TITLE 2'
BY BODYTYPE AS 'TITLE 3'
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE SUBHEAD
"Test Heading for Car file"
"First 4 Columns <+0>Last 3 Columns"
"H-Country <+0>H-Car <+0>H-BType <+0>H-DCost <+0>H-RCost <+0>H-Sales <+0>H-Model "
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
GRID=ON,
$
TYPE=REPORT,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
LEFTGAP=0.000000,
$
TYPE=TABHEADING, GRID=OFF, $
TYPE=TABHEADING, LINE=1, OBJECT=TEXT, SIZE=12, STYLE=BOLD,
JUSTIFY=CENTER, POSITION=3.5, $
TYPE=TABHEADING, LINE=2, OBJECT=TEXT, SIZE=10, ITEM=1, STYLE=BOLD,
JUSTIFY=LEFT, $
TYPE=TABHEADING, LINE=2, OBJECT=TEXT, SIZE=10, ITEM=2, POSITION=4.00, $
TYPE=TABHEADING, LINE=3, OBJECT=TEXT, SIZE=10, ITEM=1, STYLE=BOLD,
JUSTIFY=LEFT, $
TYPE=TABHEADING, LINE=3, OBJECT=TEXT, SIZE=10, ITEM=2, POSITION=1.00, $
TYPE=TABHEADING, LINE=3, OBJECT=TEXT, SIZE=10, ITEM=3, POSITION=1.90, $
TYPE=TABHEADING, LINE=3, OBJECT=TEXT, SIZE=10, ITEM=4, POSITION=2.70, $
TYPE=TABHEADING, LINE=3, OBJECT=TEXT, SIZE=10, ITEM=5, POSITION=3.30, $
TYPE=TABHEADING, LINE=3, OBJECT=TEXT, SIZE=10, ITEM=6, POSITION=3.90, $
TYPE=TABHEADING, LINE=3, OBJECT=TEXT, SIZE=10, ITEM=7, POSITION=4.60, $
ENDSTYLE
END
January 07, 2009, 11:56 AM
GinnyJakesWhy don't you try positioning using column names as opposed to metrics.
Here is an example of one change you could make:
TYPE=TABHEADING, LINE=2, OBJECT=TEXT, SIZE=10, ITEM=2, POSITION=RETAIL_COST, $
January 07, 2009, 12:03 PM
ok_dhsquote:
Posted January 07, 2009 10:56 AM
Thanks for the quick response. If I try to align it using column names, items are LEFT justified. I would check and see if I could justify it to the center of the column. Thanks again.
January 07, 2009, 12:07 PM
GinnyJakesYou could try putting some unprintable characters in front of the text you want to display.
January 07, 2009, 01:22 PM
Darin LeeI think Ginny's suggestion will give you what you want. However, you do have the WIDTH= or WRAP= attributes for columns that would set columns to a fixed width. Mickey Grackin has a couple of excellent articles in the Developer Center/Tips and Techniques called WebFOCUS HTML and PDF Report Design
Part I and
Part II about PDF formatting that may be of some use to you.
January 07, 2009, 02:05 PM
ok_dhsExcellent articles! Thanks for your help guys.