Focal Point
[CLOSED] Center align entire body in PDF

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

April 02, 2009, 03:23 PM
Tasha
[CLOSED] Center align entire body in PDF
I need to center align the entire body of the report in PDF, not justify the text in the columns. I have a report that the HEADING is centered on the page and I have about 10 columns listed using the OVER command, so they proceed down the page in a 2 column table. I want the entire table centered on the page under that HEADING in PDF format. Any ideas?

This message has been edited. Last edited by: Kerry,


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
April 02, 2009, 04:18 PM
Waz
I don't believe this can be automatically done, but if its fixed in width, you can play with the left margin parameter in the stylesheet.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 02, 2009, 04:28 PM
Tasha
I tried this however it moves the HEADING over as well which in turn doesn't allow it to be aligned together.


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
April 02, 2009, 04:45 PM
Francis Mariani
What about using the LEFTGAP attribute? It's not centering, but it at least gives you the possibility of positioning the left most column...

TABLE FILE CAR
SUM
SALES
BY CAR
HEADING
"WEBFOCUS REPORT WEBFOCUS REPORT WEBFOCUS REPORT"
ON TABLE SET STYLESHEET *
FONT='ARIAL', SIZE=8, SQUEEZE=ON, $
TYPE=REPORT, COLUMN=CAR, LEFTGAP=1.0, $
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 02, 2009, 04:49 PM
mgrackin
Tasha,

When creating a PDF output report, the HEADING will center itself across the page INSTEAD of over the columns (normal behavior) when the HEADING information is wider than the columns themselves.

Try increasing the width of the columns on the report until the HEADING information can fit over the columns. Once this happens the HEADING information should return to normal FOCUS language behavior and CENTER over the columns.

After fixing that issue, adjust the MARGINs of the report to center the columns and HEADING on the page.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
April 02, 2009, 04:51 PM
Waz
The other option is the old fashioned IN on the first printed column

Field IN {[+-]n} ...


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 02, 2009, 04:55 PM
Tasha
I tried that too unfortunately my column headings have styling with a background color and it drags the color over from the left. Frowner


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
April 02, 2009, 04:57 PM
Tasha
My response was to Francis....will try the others right now.


WebFocus 7.6.10
Data Migrator 7.6.10
Windows NT
Excel, PDF, HTML, AHTML
April 02, 2009, 05:17 PM
mgrackin
Here's a quick example:

DEFINE FILE CAR
BLANKCOLUMN/A1='';
END
TABLE FILE CAR
HEADING
"This is a long HEADING which will not fit over the columns</1"
PRINT COUNTRY OVER CAR OVER MODEL OVER BODYTYPE
BY BLANKCOLUMN AS ''
BY COUNTRY NOPRINT NOSPLIT
BY CAR NOPRINT
BY MODEL NOPRINT
BY BODYTYPE NOPRINT SKIP-LINE
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, SQUEEZE=OFF, LEFTGAP=0.05, RIGHTGAP=0.05,
ORIENTATION=PORTRAIT, TOPMARGIN=0.75, BOTTOMMARGIN=0.75, LEFTMARGIN=0.75, RIGHTMARGIN=0.75,
STYLE=BOLD, SIZE=12, FONT='ARIAL',$
TYPE=HEADING, HEADALIGN=BODY, JUSTIFY=CENTER, BORDER=MEDIUM,$
TYPE=REPORT, COLUMN=P1, WRAP=2.00,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
April 02, 2009, 05:31 PM
Waz
I think Mickey's got the way to go!


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 03, 2009, 09:22 AM
bcowley
For reports that are just on one page I've used a compound report to do this. The first report is just the header, centered over the page by fixing the width of the heading. Then compound the body of the report next. This works great for PDF. Obviously this only works for one page reports.


______________________
WF Version: Prod/Test : WebFOCUS 7.67; ETL 7.67

OP system: WIN2K