Focal Point
[SOLVED] Display title for each row/display head for each row

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

September 15, 2011, 10:09 AM
MKS
[SOLVED] Display title for each row/display head for each row
Hi,

I need to display data as below

name cost location
Dave 456 MAL
name cost location
John 789 KAED
name cost location
Jack 389 YARJ

I need the title for the column to be printed for each row. Is it possible?

Thank you

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


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
September 15, 2011, 10:52 AM
<FreSte>
Try this:

TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
BY CAR
ON TABLE SET LINES 1
ON TABLE SET PAGE NOPAGE
END

September 15, 2011, 10:55 AM
Prarie
Nice!
I think I knew that at one time in life...
September 15, 2011, 11:22 AM
MKS
Hi,

I tried it. It didn't print any header, below is what I got

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

What i was expecting was

COUNTRY CAR DEALER_COST
ENGLAND JAGUAR 18,621

COUNTRY CAR DEALER_COST
ENGLAND JENSEN 14,940

COUNTRY CAR DEALER_COST
ENGLAND TRIUMPH 4,292

COUNTRY CAR DEALER_COST
FRANCE PEUGEOT 4,631

COUNTRY CAR DEALER_COST
ITALY ALFA ROMEO 16,235

COUNTRY CAR DEALER_COST
ITALY MASERATI 25,000

COUNTRY CAR DEALER_COST
JAPAN DATSUN 2,626

COUNTRY CAR DEALER_COST
JAPAN TOYOTA 2,886

COUNTRY CAR DEALER_COST
W GERMANY AUDI 5,063

COUNTRY CAR DEALER_COST
W GERMANY BMW 49,500

Thank you


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
September 15, 2011, 11:31 AM
ABT
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
BY CAR
HEADING
" "
ON TABLE SET LINES 1
ON TABLE SET PAGE NOPAGE
END


Works for me. I added the HEADING to give the blank line. What RDBMS is your CAR deployed into (mine is the FOCUS)? Maybe that's the discrepency?

Maybe:
TABLE FILE CAR
PRINT
*
ON TABLE HOLD AS MY_CAR FORMAT FOCUS
END

TABLE FILE MY_CAR
SUM DEALER_COST
BY COUNTRY
BY CAR
HEADING
" "
ON TABLE SET LINES 1
ON TABLE SET PAGE NOPAGE
END


- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
September 15, 2011, 11:42 AM
MKS
quote:
TABLE FILE CAR PRINT * ON TABLE HOLD AS MY_CAR FORMAT FOCUS END TABLE FILE MY_CAR SUM DEALER_COST BY COUNTRY BY CAR HEADING " " ON TABLE SET LINES 1 ON TABLE SET PAGE NOPAGE END


Could this be a version issue I am not getting it.


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP
September 15, 2011, 12:46 PM
<FreSte>
quote:

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


In the example above it looks like you're printing the records to a HOLD-file (format alpha).
What output format do you need and what is it what you need to do with it ?
September 15, 2011, 01:35 PM
Doug
Consider this:
DEFINE FILE CAR
HEADER1/A7 = 'COUNTRY' ;
HEADER2/A3 = 'CAR' ;
HEADER3/A5 = 'MODEL' ;
HEADER4/A5 = 'DCOST' ;
END
TABLE FILE CAR
SUM HEADER1 AS '' HEADER2 AS '' HEADER3 AS '' HEADER4 AS '' 
OVER COUNTRY AS '' CAR AS '' MODEL AS '' DCOST AS '' 
BY MODEL NOPRINT
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
GRID=OFF,$
TYPE=REPORT, COLUMN=HEADER1, STYLE=BOLD,$
TYPE=REPORT, COLUMN=HEADER2, STYLE=BOLD,$
TYPE=REPORT, COLUMN=HEADER3, STYLE=BOLD,$
TYPE=REPORT, COLUMN=HEADER4, STYLE=BOLD,$
ENDSTYLE
END
Which results in this (only a few lines are displayed here):

COUNTRY CAR MODEL      DCOST
W GERMANY AUDI 100 LS 2 DOOR AUTO 5,063
COUNTRY CAR MODEL      DCOST
ITALY ALFA ROMEO 2000 4 DOOR BERLINA 4,915
COUNTRY CAR MODEL      DCOST
ITALY ALFA ROMEO 2000 GT VELOCE 5,660
COUNTRY CAR MODEL      DCOST
ITALY ALFA ROMEO 2000 SPIDER VELOCE 5,660
COUNTRY CAR MODEL      DCOST
W GERMANY BMW 2002 2 DOOR 5,800


Sorry, I shouuld have used the EMPDATA file or something closer to a NAME related source...

Anyway, I hope this helps...
September 15, 2011, 01:45 PM
Doug
Or, you could set up an incremental counter (COMPUTE or DEFINE) which would be used as a reference in a SUBHEAD / (WHEN counter ne last counter (which would be always true) and, of course your SUBHEAD would be something like "COUNTRY CAR MODEL DCOST "... Or...
September 15, 2011, 01:45 PM
Tom Flynn
The version in the signature is WebFocus 5.2.5...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
September 15, 2011, 05:36 PM
Doug
Tom: Is the suggestion stated in my post of Sep 15 2011 13:35 or 13:45 not available on 5.2.5?
September 15, 2011, 06:08 PM
Waz
Just tested in WF 5.2.4

TABLE FILE CAR
PRINT *
ON TABLE HOLD AS MY_CAR FORMAT FOCUS
END
TABLE FILE MY_CAR
SUM DEALER_COST
BY COUNTRY
BY CAR
HEADING
" "
ON TABLE SET LINES 1
ON TABLE SET PAGE NOPAGE
END 


Output is OK. From the command line.

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
ENGLAND     JAGUAR                 18,621

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
ENGLAND     JENSEN                 14,940

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
ENGLAND     TRIUMPH                 4,292

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
FRANCE      PEUGEOT                 4,631

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
ITALY       ALFA ROMEO             16,235

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
ITALY       MASERATI               25,000

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
JAPAN       DATSUN                  2,626

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
JAPAN       TOYOTA                  2,886

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
W GERMANY   AUDI                    5,063

COUNTRY     CAR               DEALER_COST
-------     ---               -----------
W GERMANY   BMW                    49,500


You may be right, it could be a version issue.


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!

September 15, 2011, 10:08 PM
MKS
quote:
Originally posted by Doug:
Consider this:
DEFINE FILE CAR
HEADER1/A7 = 'COUNTRY' ;
HEADER2/A3 = 'CAR' ;
HEADER3/A5 = 'MODEL' ;
HEADER4/A5 = 'DCOST' ;
END
TABLE FILE CAR
SUM HEADER1 AS '' HEADER2 AS '' HEADER3 AS '' HEADER4 AS '' 
OVER COUNTRY AS '' CAR AS '' MODEL AS '' DCOST AS '' 
BY MODEL NOPRINT
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
GRID=OFF,$
TYPE=REPORT, COLUMN=HEADER1, STYLE=BOLD,$
TYPE=REPORT, COLUMN=HEADER2, STYLE=BOLD,$
TYPE=REPORT, COLUMN=HEADER3, STYLE=BOLD,$
TYPE=REPORT, COLUMN=HEADER4, STYLE=BOLD,$
ENDSTYLE
END
Which results in this (only a few lines are displayed here):

COUNTRY CAR MODEL      DCOST
W GERMANY AUDI 100 LS 2 DOOR AUTO 5,063
COUNTRY CAR MODEL      DCOST
ITALY ALFA ROMEO 2000 4 DOOR BERLINA 4,915
COUNTRY CAR MODEL      DCOST
ITALY ALFA ROMEO 2000 GT VELOCE 5,660
COUNTRY CAR MODEL      DCOST
ITALY ALFA ROMEO 2000 SPIDER VELOCE 5,660
COUNTRY CAR MODEL      DCOST
W GERMANY BMW 2002 2 DOOR 5,800


Sorry, I shouuld have used the EMPDATA file or something closer to a NAME related source...

Anyway, I hope this helps...


Thanks Doug. This did help


WebFocus 5.2.5
HP-UX(UNIX)
EXCEL, HTML, PDF and OLAP