Focal Point
[CLOSED] Heading alignment for webfocus HTML report.

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

June 03, 2004, 03:26 PM
<Scott_W>
[CLOSED] Heading alignment for webfocus HTML report.
Is there a way in the heading of a report to automatically left, center, and right justify parts of that heading.

Essentially in a heading on one line I would like to left justify something, center something, and then right justify something else.

[I have example code if needed]

Details: we are using devstudio 521 and the report output is HTML.

Any ideas or tips?
Thanks.

This message has been edited. Last edited by: Kerry,
June 03, 2004, 07:57 PM
webfocuspgm
Style sheet may be the way you want to go ....
Here is an example of one of mine. There are all kinds of things you can do with style sheets.

ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=HEADING, LINE=1, SIZE=12, STYLE=BOLD, JUSTIFY=CENTER, COLOR=RED, $
TYPE=HEADING, LINE=2, SIZE=08, JUSTIFY=LEFT, $
TYPE=HEADING, LINE=3, SIZE=10, STYLE=BOLD, JUSTIFY=CENTER, COLOR=RED, $
TYPE=HEADING, LINE=4, SIZE=10, STYLE=BOLD, JUSTIFY=CENTER, COLOR=RED, $
TYPE=HEADING, LINE=5, SIZE=08, JUSTIFY=LEFT, $
TYPE=HEADING, LINE=6, SIZE=08, JUSTIFY=LEFT, $
ENDSTYLE
June 03, 2004, 08:57 PM
susannah
yeah, here's the trick on aligning parts of a heading;
You need to define a variable with contains the heading, all its parts, embraced with html code.
The heading gets put into a TABLE,with , 1 row and, say, 3 cells. The first cell willcontain what you want left justified. the second cell will contain what you want centered.
and the third cell will contain what you want right justified. And you'll control placement by WIDTH and ALIGN attributes in the TD tags. There's an article on this on the ibi tech support site, but i can't find it.
I'll keep looking and let you know.
Ah. found it: http://techsupport.informationbuilders.com/tech/wbf/wbf_tcn_021.html
June 03, 2004, 09:03 PM
Mikel
Easy, Try this example using HEADALIGN=INTERNAL combined with JUSTIFY.


TABLE FILE CAR
HEADING
"LEFT<+0>CENTER<+0>RIGHT"
" "
PRINT
COUNTRY CAR MODEL SALES
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=INTERNAL, $
TYPE=HEADING, ITEM=2, JUSTIFY=CENTER, $
TYPE=HEADING, ITEM=3, JUSTIFY=RIGHT, $
END
Regards,
Mikel

This message has been edited. Last edited by: <Mabel>,
June 03, 2004, 09:06 PM
susannah
hey, i like Mikel's way better.
http://techsupport.informationbuilders.com/tech/wbf/wbf_tcn_064.html
June 07, 2004, 10:26 PM
<Brett Johnson>
I am able to get this to work with hard coded text, but not defined fields in the heading. If you have a defined field in left, and another in near the center of page, it slides the 2nd defined field off the page, or way beyond the # of columns that you specified. Any ideas?
June 08, 2004, 09:58 PM
susannah
Brett, we need to see the code, please.
June 11, 2004, 12:23 PM
David Sibert
Sometimes you have to use POSITION=5.5 in the style for the field.

Also, I found that I have to use <+0 sometimes.

Be aware that you still have to declare what it is you are trying to use Field or Text in the style.

-* TYPE=HEADING, LINE=7, OBJECT=TEXT, ITEM=1,
-*POSITION=N4, $

N4 is the fourth field in the table. This can be replaced with a hard spot as stated above.

David
July 16, 2004, 11:52 AM
<pranas>
Hi,

I've stocked with the similar but not for SUBFOOT

I want to have some total values of SUBFOOT to be positioned below sertain data columns.

TABLE
SUM F1 F2 F3 F4 F5 F6 CHARGE FST.CURRENCY_CODE
BY CURRENCY_CODE SUP-PRINT
...
ON TABLE NOTOTAL
ON TABLE SET PAGE-NUM OFF
ON TABLE SET ONLINE-FMT &OUTPUT_FORMAT

ON CURRENCY_CODE RECAP TOTCHARGE=CHARGE;
SUBFOOT
"Total:<+0>"

ON TABLE SET STYLE *
-INCLUDE ubp
TYPE=REPORT, ORIENTATION=LANDSCAPE, $
TYPE=SUBFOOT, HEADALIGN=BODY,$
TYPE=SUBFOOT,
LINE=1,
OBJECT=TEXT,
ITEM=1,
POSITION=N1,
$
TYPE=SUBFOOT,
LINE=1,
OBJECT=FIELD,
ITEM=2,
POSITION=N7,
$
TYPE=SUBFOOT,
LINE=1,
OBJECT=FIELD,
ITEM=3,
POSITION=N8,
$

ENDSTYLE
END


Expected position of fields:

I expect position of the first ITEM (TEXT "Total") to be placed below 1st column.

The ITEM=2 (FIELD with numeric value) to be placed in below 7th column.

The ITEM=2 (FIELD with text value) to be placed in below 8th column.

Actual result:
The 1 ITEM below column 1
The 2 ITEM below column 2
The 3 ITEM below column 3

Note the same behavior with simple TEXT ITEMS. WebFOCUS 5.2.5

Some suggestions?

Thanks,
Pranas
July 16, 2004, 01:36 PM
<kj>
Pranas,
I had similar problem with HTML output. But it works fine with PDF output. It may be a bug with HTML output. I put <+0> 2 times if I want two column space inbetween. You may want to try this. This will not effect PDF output. and Instead of N1, N2,... I used P1, P2,...

Thanks,
kj
July 16, 2004, 01:59 PM
<Pietro De Santis>
A little hint: when playing with WebFOCUS style sheets, add a COLOR tag to see if the style sheet entry is actually being applied as you want it. If you find that the element is not being coloured, then that particular entry is not coded correctly. For your subfoots, you may need to have spaces between the <+0> .

Pietro.
July 16, 2004, 02:10 PM
<Grzegorz>
Example which I suppose is a good illustration of how the HEADING (or FOOTING, SUBHEADING etc.) with HEADALIGN=BODY works:
(WF 5.2.3 on Windows)

-DEFAULT &OUTFMT=HTML
DEFINE FILE CAR
FIELD1/A2 = 'F1';
FIELD2/A2 = 'F2';
FIELD3/A2 = 'F3';
SAL1/I6 = SALES;
SAL2/I6 = SALES;
SAL3/I6 = SALES;
SAL4/I6 = SALES;
SAL5/I6 = SALES;
END
-RUN
END
TABLE FILE CAR
HEADING
" <+0>TEXT1 <|FIELD1 TEXT2<0> <0> <0> <0><|FIELD2"
SUM SAL1 SAL2 SAL3 SAL4 SAL5
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SET STYLE *
TYPE=REPORT, GRID=ON, SIZE=10, ORIENTATION=LANDSCAPE, $
TYPE=HEADING, HEADALIGN=BODY, STYLE=BOLD, FONT=ARIAL, BACKCOLOR=YELLOW,$

-* The leading space is ITEM=1 for TEXT objects
TYPE=HEADING, OBJECT=TEXT, ITEM=2, COLOR=RED, POSITION=P2,$
TYPE=HEADING, OBJECT=TEXT, ITEM=3, COLOR=BLUE, POSITION=P3, $
-* TEXT objects, and FIELD objects are counted separately !
TYPE=HEADING, OBJECT=FIELD, ITEM=1, COLOR=BLUE, POSITION=P4,$
TYPE=HEADING, OBJECT=FIELD, ITEM=2, COLOR=RED, POSITION=P8,$

ENDSTYLE
ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET ONLINE-FMT &OUTFMT
END

This is also the result of experiments and I agree with kj:


(I used the syntax <|FIELD to protect the code against being removed by the forum engine - should be without pipe |)

Regards
Grzegorz
July 19, 2004, 06:25 AM
<pranas>
Thanks gurus:
kj, Pietro De Santis, Grzegorz

It is very complicated procedure to put subtotals in correct columns.
I think FOCUS language may be extended in order to support "supressing display of BY values"

Like "
 ... [BY=PRINT|NOPRINT] ... 
... "?!
I hope project development team will see my post.
December 05, 2005, 02:42 PM
<Mabel>
quote:
Originally posted by Mikel:
Easy, Try this example using HEADALIGN=INTERNAL combined with JUSTIFY.


TABLE FILE CAR
HEADING
"LEFT<+0>CENTER<+0>RIGHT"
" "
PRINT
COUNTRY CAR MODEL SALES
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=INTERNAL, $
TYPE=HEADING, ITEM=2, JUSTIFY=CENTER, $
TYPE=HEADING, ITEM=3, JUSTIFY=RIGHT, $
END
Regards,
Mikel

March 15, 2013, 10:37 AM
Marc97229
This page http://ecl.informationbuilders.../source/topic213.htm suggests there is an Alignment Grid for aligning fields in Headings and Footings.
But the things is always disabled Frowner.


WebFOCUS 8.0.0.8, Windows 7
March 15, 2013, 10:56 AM
Prarie
The doc you have is for 7.7.03 - can you find a 8.0?
March 15, 2013, 11:01 AM
Marc97229
But indeed, Mabel,

TYPE=HEADING,
HEADALIGN=INTERNAL,
$
TYPE=FOOTING,
HEADALIGN=INTERNAL,
$

is what I needed. Thanks!


WebFOCUS 8.0.0.8, Windows 7
March 15, 2013, 11:04 AM
Marc97229
WebFOCUS 8 docs are here: http://infocenter.ibi.com/wf80/index.jsp

Why in the world product documentation is hidden behind a username and password is beyond me. I am probably not allowed to give you the credentials I got.


WebFOCUS 8.0.0.8, Windows 7
March 15, 2013, 02:22 PM
Prarie
So you pay your maintence fees.