Focal Point
[CLOSED] align single heading line over columns in excel?

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

October 02, 2020, 08:28 PM
sh98110
[CLOSED] align single heading line over columns in excel?
I have the following code-
TABLE FILE CAR
-* COMPUTE a/A1 = '|';
PRINT
CAR.ORIGIN.COUNTRY AS 'a-country'
CAR.COMP.CAR AS 'a-car'
CAR.CARREC.MODEL AS 'a-model'
CAR.ORIGIN.COUNTRY AS 'b-country'
CAR.COMP.CAR AS 'b-car'
CAR.CARREC.MODEL AS 'b-model'
BY CAR.ORIGIN.COUNTRY AS 'first sort field'
BY CAR.COMP.CAR AS 'second sort field'
ON TABLE PCHOLD FORMAT XLSX
END

I have a few lines of report heading text that are left justified fine, but I went to add a last line of heading text, and cannot figure it out.

I would like this last heading text line, as follows:
" a-fields (magical spacing) b-fields"

to be centered over the A-fields / B-fields in the report (past the two sort fields). I tried playing with COLSPAN, but that messes up my normal first lines of heading text. Suggestions gratefully accepted. Thanks!

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
October 04, 2020, 11:27 AM
dbeagan
Does this work for you?
 TABLE FILE car
 "Heading one"
 "Heading two"
 " <+0> <+0>a-fields<+0>b-fields"
 PRINT
    CAR.ORIGIN.COUNTRY AS 'a-country'
    CAR.COMP.CAR       AS 'a-car'
    CAR.CARREC.MODEL   AS 'a-model'
    CAR.ORIGIN.COUNTRY AS 'b-country'
    CAR.COMP.CAR       AS 'b-car'
    CAR.CARREC.MODEL   AS 'b-model'
 BY CAR.ORIGIN.COUNTRY AS 'first sort field'
 BY CAR.COMP.CAR       AS 'second sort field'
 ON TABLE PCHOLD FORMAT XLSX
 ON TABLE SET STYLE *
 TYPE=REPORT, HEADALIGN=BODY, $
 TYPE=HEADING, LINE=3, ITEM=3, COLSPAN=3, justify=center,  $
 TYPE=HEADING, LINE=3, ITEM=4, COLSPAN=3, justify=center, $
 END  



WebFOCUS 8.2.06
October 05, 2020, 06:20 PM
sh98110
Okay- this worked great- thanks for the assist. I do have a follow-up.

In the real report, my heading text has spot markers, which the code now treats as separate objects. I would like - if possible - to treat all this code as a single (left-most) column.

Here is some modified code that illustrates the new problem:

TABLE FILE car
"Heading one"
"Heading two"
"HEADING FOR " <+0> <+0>a-fields<+0>b-fields"
PRINT
CAR.ORIGIN.COUNTRY AS 'a-country'
CAR.COMP.CAR AS 'a-car'
CAR.CARREC.MODEL AS 'a-model'
CAR.ORIGIN.COUNTRY AS 'b-country'
CAR.COMP.CAR AS 'b-car'
CAR.CARREC.MODEL AS 'b-model'
BY CAR.ORIGIN.COUNTRY AS 'first sort field' PAGE-BREAK
BY CAR.COMP.CAR AS 'second sort field'
-* ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET STYLE *
TYPE=REPORT, HEADALIGN=BODY, $


TYPE=HEADING, LINE=4, ITEM=3, COLSPAN=3, justify=center, size=14,color=rgb(12 13 116),style=bold, BACKCOLOR=LIGHT GRAY,$
TYPE=HEADING, LINE=4, ITEM=4, COLSPAN=3, justify=center, $

ENDSTYLE
END

I Would like LINE 3 to appear in its own WIDE cell, but of course, with HEAADLIGN on, each ITEM (text or spot marker) is treated uniquely. What I would like is something that could be code so: TYPE=HEADING, LINE=3, ITEM=*, COLSPAN=3, $

.. so that all the text and spot markers on that line appear in a single cell- is that possible?

Thanks again.


WebFOCUS 8
Windows, All Outputs
October 05, 2020, 09:56 PM
sh98110
ok, I posted a bad last example; here is my code-

TABLE FILE car
"Heading one"
"Heading two"
"HEADING FOR " <+0> <+0>a-fields<+0>b-fields"
PRINT
CAR.ORIGIN.COUNTRY AS 'a-country'
CAR.COMP.CAR AS 'a-car'
CAR.CARREC.MODEL AS 'a-model'
CAR.ORIGIN.COUNTRY AS 'b-country'
CAR.COMP.CAR AS 'b-car'
CAR.CARREC.MODEL AS 'b-model'
BY CAR.ORIGIN.COUNTRY AS 'first sort field' PAGE-BREAK
BY CAR.COMP.CAR AS 'second sort field'
-* ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET STYLE *
TYPE=REPORT, HEADALIGN=BODY, $
TYPE=HEADING, LINE=4, ITEM=3, COLSPAN=3, justify=center, size=14,color=rgb(12 13 116),style=bold, BACKCOLOR=LIGHT GRAY,$
TYPE=HEADING, LINE=4, ITEM=4, COLSPAN=3, justify=center, $
END

I am trying to get ALL the heading text in heading line 3 in a single cell, which is the default. Thanks.


WebFOCUS 8
Windows, All Outputs
October 05, 2020, 09:59 PM
sh98110
 
TABLE FILE car
 "Heading one"
 "Heading two"
 "HEADING FOR <COUNTRY AND <COUNTRY"
 " <+0> <+0>a-fields<+0>b-fields"
 PRINT
    CAR.ORIGIN.COUNTRY AS 'a-country'
    CAR.COMP.CAR       AS 'a-car'
    CAR.CARREC.MODEL   AS 'a-model'
    CAR.ORIGIN.COUNTRY AS 'b-country'
    CAR.COMP.CAR       AS 'b-car'
    CAR.CARREC.MODEL   AS 'b-model'
 BY CAR.ORIGIN.COUNTRY AS 'first sort field' PAGE-BREAK
 BY CAR.COMP.CAR       AS 'second sort field'
-* ON TABLE PCHOLD FORMAT XLSX
 ON TABLE SET STYLE *
 TYPE=REPORT, HEADALIGN=BODY, $


 TYPE=HEADING, LINE=4, ITEM=3, COLSPAN=3, justify=center,  size=14,color=rgb(12 13 116),style=bold, BACKCOLOR=LIGHT GRAY,$
 TYPE=HEADING, LINE=4, ITEM=4, COLSPAN=3, justify=center, $

 END


okay, now that I see I have to use the code brackets, the example should make more sense- ah, Mondays.


WebFOCUS 8
Windows, All Outputs
October 06, 2020, 09:29 AM
jgelona
Well if you are limiting this to 2 counties, are the values in & variables? If so, try

"HEADING FOR &COUNTRY1 AND &COUNTRY2"



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.