Focal Point
column width in PDF reports

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5621048213

January 07, 2009, 11:39 AM
ok_dhs
column 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




Prod: WebFOCUS 7.1.3 on Linux Kernel-2.6.5 zSeries 64bit/Apache Tomcat/5.0.28 JAVA version 1.4.2_11 server
January 07, 2009, 11:56 AM
GinnyJakes
Why 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, $



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 07, 2009, 12:03 PM
ok_dhs
quote:
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.


Prod: WebFOCUS 7.1.3 on Linux Kernel-2.6.5 zSeries 64bit/Apache Tomcat/5.0.28 JAVA version 1.4.2_11 server
January 07, 2009, 12:07 PM
GinnyJakes
You could try putting some unprintable characters in front of the text you want to display.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 07, 2009, 01:22 PM
Darin Lee
I 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.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
January 07, 2009, 02:05 PM
ok_dhs
Excellent articles! Thanks for your help guys.


Prod: WebFOCUS 7.1.3 on Linux Kernel-2.6.5 zSeries 64bit/Apache Tomcat/5.0.28 JAVA version 1.4.2_11 server