Focal Point
[SOLVED] Repeating the title for a each type with across field

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

February 10, 2016, 12:25 PM
vnf
[SOLVED] Repeating the title for a each type with across field
I am working on a across report where I would like the title heading to appear each type a Car changed.

I tried to use the subheading but I don't know how to include the across column to the subtitle.

here is the car sample:
APP PREPENDPATH IBISAMP
HEADING
"SAMPLE REPORT"
TABLE FILE CAR
SUM
CAR.BODY.SALES
BY CAR.COMP.CAR
BY CAR.CARREC.MODEL
ACROSS LOWEST CAR.ORIGIN.COUNTRY ACROSS-TOTAL
ON TABLE COLUMN-TOTAL AS 'TOTAL'

END

in this sample I would like the following title to appear on each time a car change.
it will be something like CAR MODEL ... ENGLAND FRANCE ITALY ...



thanks,

Vera

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


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
February 10, 2016, 02:55 PM
eric.woerle
Vera you mean like this?

TABLE FILE CAR
SUM CAR.BODY.SALES
BY CAR.COMP.CAR  
BY CAR.CARREC.MODEL
ACROSS LOWEST CAR.ORIGIN.COUNTRY ACROSS-TOTAL
HEADING 
"SAMPLE REPORT"
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON CAR.COMP.CAR SUBHEAD 
"CAR = <CAR , MODEL = <MODEL"
END


Its unclear what your are trying to achieve.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
February 10, 2016, 03:56 PM
Waz
Agreed,

Vera, can you post a mock up.
Make sure you use the code tags so it keeps the layout.


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!

February 11, 2016, 08:10 AM
MartinY
As far as I understand, vnf is requesting for something like this:
SAMPLE REPORT							
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
CAR		MODEL						
ALFA ROMEO	2000 GT VELOCE				12400				12400
		2000 SPIDER VELOCE			13000				13000
		2000 4 DOOR BERLINA			4800				4800
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
AUDI		100 LS 2 DOOR AUTO					7800		7800
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
BMW		2002 2 DOOR						8950		8950
		2002 2 DOOR AUTO					8900		8900
		3.0 SI 4 DOOR						14000		14000
		3.0 SI 4 DOOR AUTO					18940		18940
		530I 4 DOOR						14000		14000
		530I 4 DOOR AUTO					15600		15600
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
DATSUN		B210 2 DOOR AUTO				43000			43000
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
JAGUAR		V12XKE AUTO		0						0
		XJ12L AUTO		12000						12000
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
JENSEN		INTERCEPTOR III		0						0
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
MASERATI	DORA 2 DOOR				0				0
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
PEUGEOT		504 4 DOOR		0						0
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
TOYOTA		COROLLA 4 DOOR DIX AUTO				35030			35030
					COUNTRY					
					ENGLAND	FRANCE	ITALY	JAPAN	W GERMANY	TOTAL
TRIUMPH		TR7			0						0
TOTAL					12000	0	30200	78030	88190		208420

Personally, I don't understand why you would like to repeat ACROSS title on every break of CAR but there is certainly a reason.

And I don't know how to perform this in FOCUS except with a page break on CAR but is resulting in many pages.
TABLE FILE CAR
SUM CAR.BODY.SALES
BY CAR.COMP.CAR
BY CAR.CARREC.MODEL
ACROSS LOWEST CAR.ORIGIN.COUNTRY ACROSS-TOTAL

ON CAR PAGE-BREAK

HEADING
"SAMPLE REPORT"

ON TABLE COLUMN-TOTAL AS 'TOTAL'
END

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


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
February 11, 2016, 08:14 AM
vnf
the output of my code is
COUNTRY
CAR MODEL ENGLAND FRANCE ITALY JAPAN W GERMANY TOTAL
ALFA ROMEO 2000 4 DOOR BERLINA 4800 4800
200 GT VELOCE 12400 12400
AUDI 100 LS 2 DOOR AUTO 7800 7800
BMW .... etc



I would like something like ... where country is Across column.

CAR MODEL ENGLAND FRANCE ITALY JAPAN W GERMANY TOTAL
ALFA ROMEO 2000 4 DOOR BERLINA 4800 4800
200 GT VELOCE 12400 12400

CAR MODEL ENGLAND FRANCE ITALY JAPAN W GERMANY TOTAL
AUDI 100 LS 2 DOOR AUTO 7800 7800

CAR MODEL ENGLAND FRANCE ITALY JAPAN W GERMANY TOTAL
BMW ....


thanks,


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
February 11, 2016, 08:30 AM
vnf
quote:
Reply

Yes, I am looking for what Martin posted.

does someone know s how to do it ?

thanks,

Vera


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
February 11, 2016, 04:19 PM
Waz
Can you post your examples within the code tags please


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!

February 11, 2016, 04:24 PM
Waz
OK, so you want to repeat the column titles for each car

CAR           MODEL                              ENGLAND FRANCE ITALY JAPAN W GERMANY TOTAL
ALFA ROMEO    2000 4 DOOR BERLINA                               4800                  4800
              200 GT VELOCE                                     12400                 12400

CAR           MODEL                              ENGLAND FRANCE ITALY JAPAN W GERMANY TOTAL
AUDI          100 LS 2 DOOR AUTO                                               7800    7800

CAR           MODEL                              ENGLAND FRANCE ITALY JAPAN W GERMANY TOTAL
BMW               ....




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!

February 12, 2016, 04:43 AM
Danny-SRL
Hi Vera,

Welcome to the Forum! And thanks for including the data of your installation in your signature.

Now to your problem.
If you know the values of your ACROSS field, this is a solution:
  
-* File vera01.fex
TABLE FILE CAR
SUM SALES AS ''
BY CAR AS ''
BY MODEL AS ''
ACROSS COUNTRY NOPRINT ACROSS-TOTAL
ON CAR SUBHEAD
"CAR<+0>MODEL<+0>ENGLAND<+0>FRANCE<+0>ITALY<+0>JAPAN<+0>W GERMANY<+0>TOTAL"
ON CAR SUBFOOT
" "
ON TABLE SET PAGE OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
 INCLUDE=ENDEFLT, 
$
TYPE=SUBHEAD, HEADALIGN=BODY,
$
ENDSTYLE
END



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

February 12, 2016, 04:51 AM
Danny-SRL
However, if the number of countries is unknown, say because of some condition, you have to find how many and which they are:
  
-* File vera02.fex
TABLE FILE CAR
BY COUNTRY
-* Condition
WHERE SALES GT 0;
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS COUNTRIES
END
-RUN
-SET &CS=&LINES;
-SET &SHEAD='CAR<+0>MODEL';
-REPEAT #GETSHEAD FOR &I FROM 1 TO &CS;
-READFILE COUNTRIES
-SET &SHEAD=&SHEAD || '<+0>&COUNTRY.EVAL';
-#GETSHEAD
-SET &SHEAD=&SHEAD || '<+0>TOTAL';
-CLOSE COUNTRIES
-RUN
TABLE FILE CAR
SUM SALES AS ''
BY CAR AS ''
BY MODEL AS ''
ACROSS COUNTRY NOPRINT ACROSS-TOTAL
-* Same Condition
WHERE SALES GT 0;
ON CAR SUBHEAD
"&SHEAD"
ON CAR SUBFOOT
" "
ON TABLE SET PAGE OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
 INCLUDE=ENDEFLT, 
$
TYPE=SUBHEAD, HEADALIGN=BODY,
$
ENDSTYLE
END



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

February 18, 2016, 08:19 AM
vnf
Thanks Daniel your code works.

I don't know why when I tried to use it in my own code the expression equivalent to &COUNTRY.EVAL does not work for me. it return blank

here is my code:
TABLE FILE H_SLS_PER
BY H_SLS_PER.H_SLS_PE.ICODE2;
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS ICODE2S
END
-RUN
-SET &CS=&LINES;
-SET &SHEAD='Period<+0>';
-REPEAT #GETSHEAD FOR &I FROM 1 TO &CS;
-READFILE ICODE2S
-SET &SHEAD=&SHEAD || '<+0>&H_SLS_PER.H_SLS_PE.ICODE2.EVAL';
-#GETSHEAD
-SET &SHEAD=&SHEAD || '<+0>TOTAL';
-CLOSE ICODE2S
-RUN

all I am getting is 'Period Total' I am missing the part in between Period and Total.

Any suggestion?


WebFOCUS 8.2.0.7,
Application Studio,
Webfocus Info-Assist
iWay Service Manager,
iWay Data Migrator
Windows, All Outputs
IBM DB2/400, MS SQL-Server 2014
February 19, 2016, 04:32 AM
Danny-SRL
Methinks:
quote:

-SET &SHEAD=&SHEAD || '<+0>&H_SLS_PER.H_SLS_PE.ICODE2.EVAL';

Should read:
  
-SET &SHEAD=&SHEAD || '<+0>&ICODE2.EVAL';



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

February 19, 2016, 03:04 PM
Vera T
thank you so much


WebFOCUS DS 8.0.0.9
WebFOCUS AS 8.2.0.1
Iway Data Migrator 8.0.09
Windows, All Outputs
February 20, 2016, 02:26 PM
Danny-SRL
Vera,

Don't mention it.

A few suggestions.
1. When debugging, don't forget to use -SET &ECHO=ALL; as your first line in your fex.
2. Also insert -? & SAVEPRINT to get a list of all your variables and their values,
3. When you post code ALWAYS put it between [ CODE] tags.
Use the right-most button for this
 </> 



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