Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to position a header in Excel.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to position a header in Excel.
 Login/Join
 
Silver Member
posted
Hi,

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 XXX
HEADER1A/A16 = 'Form: CMS-21E';
HEADER1B/A24 = 'RUN DATE:'|'&DATE';

 
TABLE FILE xxx

"<HEADER1A  <HEADER1B"
 


Thanks,
Pku

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


Thanks,
Pku

Focus, WebFocus 8201 on Windows
 
Posts: 43 | Registered: May 28, 2008Report This Post
Expert
posted Hide Post
This works for HTML:

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
Hi Francis,

I tried your technique, but it did not work.(I did have "<+0>" per column to push the second header to the last column).

Thanks,
Pku


Thanks,
Pku

Focus, WebFocus 8201 on Windows
 
Posts: 43 | Registered: May 28, 2008Report This Post
Expert
posted Hide Post
There must be a space character after each <+0>


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
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



Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Guru
posted Hide Post
Goodness me. I tried.


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Virtuoso
posted Hide Post
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, 2003Report This Post
Expert
posted Hide Post
While perhaps ugly, the code I posted works in WF 5.3.2 and 7.6.5.



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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Francis,

Absolutely. And it is not ugly, it is going by the book...

The real problem is that one has to use different coding per output type.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Master
posted Hide Post
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, 2007Report This Post
Virtuoso
posted Hide Post
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, 2003Report This Post
Silver Member
posted Hide Post
I got it. Thanks all.

Pku

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


Thanks,
Pku

Focus, WebFocus 8201 on Windows
 
Posts: 43 | Registered: May 28, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] How to position a header in Excel.

Copyright © 1996-2020 Information Builders