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] Label to rows (MERGE CELLS)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Label to rows (MERGE CELLS)
 Login/Join
 
Member
posted
Dear all,

I've the following report:
 
DEFINE FILE CAR 
DUMMY/A15='RECORDS';
END
TABLE FILE CAR
SUM
     CAR.BODY.SALES OVER
     CAR.BODY.SEATS OVER
     CAR.BODY.DEALER_COST 
BY DUMMY AS ''
ACROSS CAR.ORIGIN.COUNTRY AS ''
ON TABLE SET ASNAMES ON
-*ON TABLE HOLD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=REPORT,
     GRID=OFF,
$
ENDSTYLE
END
-RUN
 


But the dummy column needs to be vertically aligned, as the following output:

|--------------------------------------------------------------------------|
|		                ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY  |
|--------------------------------------------------------------------------|
|        	 |SALES	        12000	0	30200	78030	88190      |
|RECORDS         |SEATS	        13	5	10	8	34         |
|	         |DEALER_COST	37,853	4,631	41,235	5,512	54,563     |
|--------------------------------------------------------------------------|



Is there some way to do this (with PDF and Excel also)?

Thanks in advance

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 18 | Registered: August 15, 2016Report This Post
Expert
posted Hide Post
Well, you can in HTML output by manipulating the tabular output that will be produced. It can get a little messy and you will generally be left with artefacts that you do not like, but FWIW .....

SET ACROSSLINE = OFF
DEFINE FILE CAR
   DUMMY/A1='';
   D_COUNTRY/A30 = IF COUNTRY EQ 'ENGLAND' THEN '</td><td>'||COUNTRY ELSE COUNTRY;
END
TABLE FILE CAR
SUM
     COMPUTE CNTR/I9 = LAST CNTR + 1; NOPRINT
     COMPUTE RECORDS/A100 = IF CNTR EQ 1 THEN '</td><td rowspan=3 style="vertical-align:middle;text-align:center;">Records' ELSE ''; AS '</td><td>'
BY DUMMY NOPRINT
SUM
     SALES OVER
	 SEATS OVER
	 DEALER_COST
BY DUMMY NOPRINT
ACROSS D_COUNTRY AS ''
ON TABLE SET PAGE NOLEAD
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
type=report, grid=off, $
ENDSTYLE
END
-RUN


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Hi Tony A,

It works very well to HTML.
But I will need to implement to pdf and excel also.


WebFOCUS 8
Windows, All Outputs
 
Posts: 18 | Registered: August 15, 2016Report This Post
Expert
posted Hide Post
quote:
you can in HTML output

Hence my reply.

Also, if your target is multiple output formats, it is often best to advise this within your first posting.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Thanks Tony.

I just edited the first post.


WebFOCUS 8
Windows, All Outputs
 
Posts: 18 | Registered: August 15, 2016Report This Post
Platinum Member
posted Hide Post
Hi,

Not sure if this will help in your situation, but it works for the CAR file example. (HTML, PDF OR XLSX)

Here's the code ...

-*
-** HOLD SALES DATA
-*
DEFINE FILE CAR
SRT/A1 = '1';
END
-*
TABLE FILE CAR
SUM COMPUTE VAL/A12 = FPRINT(SALES,'I6','A12');
BY SRT
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HLD_SAL
END
? HOLD HLD_SAL
-*
-** HOLD SEATS DATA
-*
DEFINE FILE CAR
SRT/A1 = '2';
END
-*
TABLE FILE CAR
SUM COMPUTE VAL/A12 = FPRINT(SEATS,'I3','A12');
BY SRT
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HLD_SEA
END
? HOLD HLD_SEA
-*
-** HOLD DEALER_COST DATA
-*
DEFINE FILE CAR
SRT/A1 = '3';
END
-*
TABLE FILE CAR
SUM COMPUTE VAL/A12 = FPRINT(DEALER_COST,'D7','A12');
BY SRT
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS HLD_DEA
END
? HOLD HLD_DEA
-*
-** COMBINE ALL THREE HOLD FILES INTO ONE
-*
TABLE FILE HLD_SAL
PRINT SRT COUNTRY VAL
ON TABLE HOLD AS HLD_ALL
MORE
FILE HLD_SEA
MORE
FILE HLD_DEA
END
? HOLD HLD_ALL
-*
-** CREATE REPORT
-*
DEFINE FILE HLD_ALL
TMP01/A15 = DECODE SRT(
'1' ' ',
'2' 'RECORDS',
'3' ' ',
ELSE ' ');
TMP02/A15 = DECODE SRT(
'1' 'SALES',
'2' 'SEATS',
'3' 'DEALER_COST',
ELSE ' ');
END
-*
TABLE FILE HLD_ALL
SUM VAL
ACROSS COUNTRY AS ''
BY SRT NOPRINT
BY TMP01 AS ''
BY TMP02 AS ''
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=ACROSSVALUE, ACROSS=1, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N4, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N5, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N6, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N7, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N8, JUSTIFY=RIGHT, $
ENDSTYLE
END
-RUN


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Member
posted Hide Post
Hi jfr99,

To HTML and PDF works well. Although this solution does not merge the cells, it helps to excel also.
Thanks a lot.


WebFOCUS 8
Windows, All Outputs
 
Posts: 18 | Registered: August 15, 2016Report This Post
Virtuoso
posted Hide Post
FYI

To simplify styling alignment for the ACROSS column use :
TYPE=DATA, ACROSSCOLUMN=VAL, JUSTIFY=RIGHT, $

Instead of :
TYPE=ACROSSVALUE, ACROSS=1, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N4, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N5, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N6, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N7, JUSTIFY=RIGHT, $
TYPE=DATA, COLUMN=N8, JUSTIFY=RIGHT, $

That way, all ACROSS columns will be affected without the need of list them one by one. And it will take in consideration more than 5 columns.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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] Label to rows (MERGE CELLS)

Copyright © 1996-2020 Information Builders