Focal Point
multiple items in a single row in header of report

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

February 21, 2008, 02:00 AM
prash.cp
multiple items in a single row in header of report
HI,



I have the following requirement in report
I have a table Emp, with columns EmpID, Name, Salary, Dept and country

The header of the report includes

----this is header of report
Dept ID: D222
Country: A, B, C, D
------------

------this is Body of the report:

Empid Name Salary

111 ABC 1000

101 www 2000



I want all the countries to which different employees belong to in a single dept to be displayed in the header ( in this example country);

Thanks!


WF 7.1.4
Windows
Excel, Html, PDF



February 21, 2008, 03:24 AM
Tony A
Prash,

You would porbably need to double pass the data soemthing like this -
TABLE FILE CAR
PRINT COMPUTE CTRY_LIST/A500V = IF SEATS   NE LAST SEATS   THEN COUNTRY   ELSE
                                IF COUNTRY EQ LAST COUNTRY THEN CTRY_LIST ELSE
                                   CTRY_LIST || ', ' | COUNTRY;
BY SEATS
ON TABLE HOLD AS CTRYSEATS
END
TABLE FILE CTRYSEATS
SUM CTRY_LIST
BY SEATS
ON SEATS SUBHEAD
"Countrys with <MAX.SEATS Seated Cars <CTRY_LIST"
END

The IF ... THEN ... ELSE are required owing to the way the data is stored in the CAR file. You will have to understand your data structure to determine what I.T.E. combination you will need to build your list.

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 
February 21, 2008, 03:40 AM
GamP
Or, almost the same as Tony's solution, but then with the empdata file (which looks a bit more like your example):
TABLE FILE EMPDATA
PRINT PIN LASTNAME SALARY
COMPUTE DIVFLD/A1000V = IF DEPT NE LAST DEPT THEN DIV ELSE
                        IF DIV EQ LAST DIV THEN DIVFLD ELSE DIVFLD || (', ' | DIV);
BY DEPT
BY DIV
ON TABLE HOLD FORMAT ALPHA
END
TABLE FILE HOLD
SUM MAX.DIVFLD NOPRINT
BY DEPT
PRINT PIN LASTNAME SALARY
BY DEPT PAGE-BREAK
BY DIV
HEADING
"Department: <DEPT"
"Divisions: <MAX.DIVFLD"
END

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988