Focal Point
[SOLVED] How to center a field in a report title

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

August 13, 2009, 01:16 PM
webmeister
[SOLVED] How to center a field in a report title
In some of my FEXes, I have a defined field that can be, say, 20 characters if one value is chosen, or if a different value is chosen, it can then be 27 characters and so on. I use this defined field in a report tile, but when I try to center it, the shorter field does not look centered, due to having extra characters that are blank.

Is there a way to redefine the field to be exactly the length of the value that gets chosen, so that it looks "nice" and centered when used in a title of a report?

Thanks in advance.... looking forward to hearing from you.

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


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
August 13, 2009, 01:31 PM
atc12345
Can you provide a Car file example of what you are trying to do?
August 13, 2009, 01:31 PM
Tom Flynn
Search on ARGLEN


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 13, 2009, 02:07 PM
Darin Lee
This is going to depend upon a couple of different things. What is your output type? If it's HTML, HTML squishes all blanks into a single blank so that may explain why your heading does not appear correctly. Try it in PDf format. Also, it makes a difference whether you have "<FIELDNAME" or "<FIELDNAME>" (with the closing carat.) The end carat preserves trailing spaces so the position of the heading would not vary in it's starting position, but would not look centered. leaving off the end carat should always center the field exactly. If there are other items on the same line you wish to center, you're probably out of luck because WF does not allow you to center only a specific item in a line. Also, if you're using spot markers for placement of a field in a heading, that wil override the justify=center in the stylesheet.

Here's an example of something that works:

-* File car.fex
TABLE FILE CAR
PRINT CAR MODEL RCOST DCOST SEATS
BY COUNTRY
HEADING
"<COUNTRY"
"1234567890"
" "
ON COUNTRY PAGE-BREAK
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=HEADING, JUSTIFY=CENTER,$
ENDSTYLE
END



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
August 19, 2009, 05:00 PM
webmeister
To all who replied, thank you. Arglen looks like the best way to go. The reply suggesting ideas for HTML and PDF would not work, since I am using Mainframe FOCUS Release 7.1, which can not deal with HTML or PDF nicely.

I will keep on trying a few other things.

Again,

Thanks!


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO