Focal Point
[SOLVED]Need to display ACROSS column exactly above BY Field

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

June 18, 2013, 02:40 PM
Rifaz
[SOLVED]Need to display ACROSS column exactly above BY Field
Hi All,

I'm new to Development not to the WebFOCUS. Hope, you all help me to get rid from this.

How do i display ACROSS column name(CAR) exactly above BY column name(COUNTRY) in EXCEL Report?

CAR ALFA ROMEO AUDI BMW DATSUN JAGUAR JENSEN MASERATI PEUGEOT TOYOTA TRIUMPH
COUNTRY
ENGLAND 18,621 14,940 4,292
FRANCE 4,631
ITALY 16,235 25,000
JAPAN 2,626 2,886
W GERMANY 5,063 49,500

This is my first query gonna post in FOCAL point. I'd really like to appreciate this forum, which helps much in WF report development.

Thanks,
Rifaz

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


-Rifaz

WebFOCUS 7.7.x and 8.x
June 18, 2013, 04:54 PM
Danny-SRL
Rifaz,

Try this:
SET ACROSSTITLE = SIDE
TABLE FILE CAR
SUM
     SALES
BY  LOWEST COUNTRY
ACROSS CAR
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
 include=endeflt, $
type=report, border=light, $
TYPE=DATA,
     ACROSSCOLUMN=N8,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
$
TYPE=ACROSSVALUE,
     ACROSS=1,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
$
ENDSTYLE
END



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

June 18, 2013, 06:16 PM
Waz
quote:
SET ACROSSTITLE = SIDE


Awesome command.

But I think it came in in 7.7


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 18, 2013, 07:14 PM
John W Price
7704 ACROSSTITLE = option ..... control location of ACROSS field titles in PDF, EXL2K, EXL07, and HTML output
7701 option: ABOVE [default] titles are displayed above the values
7701 option: SIDE titles are displayed to the left of the values
From the WebFocus Keysheet - see Aviter.com

First available in 7.7.01. Excel and HTML output added in 7.7.04

This message has been edited. Last edited by: John W Price,



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com
June 19, 2013, 03:19 AM
Rifaz
Thanks much Daniel and John!!!. But, still we're in 7611, is there any possible workaround for this? Titles can be a STATIC.


-Rifaz

WebFOCUS 7.7.x and 8.x
June 19, 2013, 05:44 PM
Waz
An option is to convert the across field to columns.

One way to the use the across and HOLD the output. Then it get a bit tricky, as the number of fields becomes dymanic.

Have a look at what happens when you hold a TABLE request with an ACROSS.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 20, 2013, 01:07 AM
Danny-SRL
Rifaz,

A 7.6 approach:
  
TABLE FILE CAR
BY CAR
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS CC
END
-RUN
-SET &CARS=&LINES;
DEFINE FILE CAR
-REPEAT #CARSALES FOR &I FROM 1 TO &CARS;
-READFILE CC
-SET &CAR.&I='&CAR.EVAL';
SALES&I=IF CAR EQ '&CAR.&I' THEN SALES ELSE 0;
-#CARSALES
END
-CLOSE CC
TABLE FILE CAR
SUM
-SET &HEAD='CAR';
-REPEAT #SALES FOR &I FROM 1 TO &CARS;
    SALES&I AS ''
-SET &HEAD=&HEAD | '<+0>' | &CAR.&I.EVAL;
-#SALES
BY  COUNTRY AS 'COUNTRY'
HEADING
"&HEAD"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
 include=endeflt, $
type=report, border=light, $
TYPE=HEADING, HEADALIGN=BODY,$
TYPE=DATA,
     ACROSSCOLUMN=N8,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
$
TYPE=ACROSSVALUE,
     ACROSS=1,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
$
ENDSTYLE
END



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

June 20, 2013, 11:59 AM
Rifaz
Thanks Danny,

I will try reproduce in my house using the real datas and let you know.

Danny, I'm still wondering, how did he do that? You rocked really!!! Smiler

Hoping, i'm going to attain developing the report as desired.

Thanks,
Rifaz


-Rifaz

WebFOCUS 7.7.x and 8.x
June 21, 2013, 08:59 AM
Rifaz
Thanks Danny,

Somehow, customer said, ok with this report.
Good news is that,soon, we're going to migrate to 80x. from 7.6.11 Smiler. So, i use John & Waz suggestion at ease to create report.

I'm going to close this post as solved.

Happy Weekend!!!

Thanks,
Rifaz


-Rifaz

WebFOCUS 7.7.x and 8.x
September 04, 2013, 10:02 AM
hainguyen
Thanks. I got the same problem and this helps.


WebFOCUS 7.7.03
Windows, All Outputs