As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I am trying to align my HEADER1A to the left and HEADER1B to the right on the same header line in Excel file. Does anyone know how to do it? Thank you.
DEFINE FILE CAR
HEADER1A/A16 = 'FORM: CMS-21E';
HEADER1B/A24 = 'RUN DATE:'|'&DATE';
END
TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
BY SEATS
HEADING
"<HEADER1A<HEADER1B"
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=INTERNAL, $
TYPE=HEADING, ITEM=2, JUSTIFY=RIGHT, COLOR=BLUE, $
ENDSTYLE
END
EXL2K is a little nasty. This appears to work (someone else may have a better idea):
DEFINE FILE CAR
HEADER1A/A16 = 'FORM: CMS-21E';
HEADER1B/A24 = 'RUN DATE:'|'&DATE';
END
TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
BY SEATS
HEADING
"<HEADER1A <+0> <+0> <HEADER1B"
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
Put one "<+0> " per column to have the second part of the Heading aligned to the last column.
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
In our shop, when we want to right justify part of the header and left justify the rest of the header in EXCEL the way you described, we use the method that Francis described.
Remember also, to make sure to include line I've bolded TYPE=HEADING, HEADALIGN=BODY, $in Francis code below or "<+0>" will not work.
DEFINE FILE CAR
HEADER1A/A16 = 'FORM: CMS-21E';
HEADER1B/A24 = 'RUN DATE:'|'&DATE';
END
TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
BY SEATS
HEADING
"<HEADER1A <+0> <+0> <HEADER1B"
ON TABLE SET STYLE *
[B]TYPE=HEADING, HEADALIGN=BODY, $[/B]
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
There is no way to do this as far as I know by using the HOLD FORMAT EXL2K. There is a way to fool the browser to open the HTML output as an Excel file. Then you can use HOLD FORMAT HTML and all the supported formatting that goes along with it. The key is SET HTMLFORMTYPE = XLS.
SET HTMLFORMTYPE = XLS DEFINE FILE CAR HEADER1A/A16 = 'FORM: CMS-21E'; HEADER1B/A24 = 'RUN DATE:'|'&DATE'; END TABLE FILE CAR SUM SALES BY COUNTRY BY CAR BY MODEL BY SEATS -********** -* No space between fields in the HEADING -********** HEADING "<HEADER1A<HEADER1B" ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * TYPE=HEADING, HEADALIGN=BODY,$ TYPE=HEADING, LINE=1, OBJECT=FIELD, ITEM=1, COLSPAN=2,$ TYPE=HEADING, LINE=1, OBJECT=FIELD, ITEM=2, COLSPAN=3, JUSTIFY=RIGHT,$ ENDSTYLE ON TABLE HOLD FORMAT HTML END -RUN -HTMLFORM BEGIN !IBI.FIL.HOLD; -HTMLFORM END
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
This is very similar to Mickey's answer, but I wanted to point out that you can PCHOLD the file format EXL2K and that you don't need the OBJECT in the stylesheet. It is a whole lot easier to count the number of items without worrying whether they are text or fields.
DEFINE FILE CAR
HEADER1A/A16 = 'FORM: CMS-21E';
HEADER1B/A24 = 'RUN DATE:'|'&DATE';
END
TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
BY SEATS
HEADING
"<HEADER1A<HEADER1B"
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
TYPE=HEADING,
ITEM=1,
COLSPAN=2,
$
TYPE=HEADING,
ITEM=2,
COLSPAN=3,
JUSTIFY=RIGHT,
$
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
I tried going directly to EXL2K format and for some reason it would not respect the COLSPAN. However, it looks like it does even though the manual says it does not.
Definitely use the solution from PBrightwell.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003