Focal Point
[SOLVED] need to get a common title for two columns.

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

July 16, 2009, 03:17 PM
swati
[SOLVED] need to get a common title for two columns.
Hi,
i am attaching a sample code...
TABLE FILE EMPLOYEE
PRINT
LAST_NAME
FIRST_NAME
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=ON,
FONT='ARIAL',
SIZE=9,
$
ENDSTYLE
END
-- this code produce the output with two columns with the last name and first name.
now i want to have a column title as full name above the last and first name columns,how can i accomplish this.....
like
FULLNAME
LASTNAME |FIRSTNAME

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


7.6.7
windows
PDF,EXCEL.
July 16, 2009, 03:29 PM
Microfich
This is a very basic question. If you do not have a manual, please order one or go to the documentation on this site. You will get your answers much faster this way.

One way:
TABLE FILE EMPLOYEE
PRINT 
LAST_NAME AS 'FULLNAME'
FIRSTNAME AS ''
END
  



WebFOCUS 8105
Windows;
DB2, UDB, SQL Server, Oracle
FOCUS-WebFOCUS since 1981
July 16, 2009, 03:32 PM
Darin Lee
This is a pretty basic question - do you have a FOCUS manual handy?

You can make the column name whatever you want with the AS statement (AS 'FULLNAME,LASTNAME|FIRSTNAME') - or you can just use the OVER command which stacks the column titles by default.

Define a new field FULLNAME concatenating the last and first names and then use the OVER


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 16, 2009, 03:37 PM
swati
DARRIN,
i know about the concatenation,but i dont want to use it because my goal is to get a title above the last name and first name as full name.
if i create a field and use concatenation then i am getting this which is not i am looking for.,

DEFINE FILE EMPLOYEE
Fullname/A39=LAST_NAME| FIRST_NAME;
END
TABLE FILE EMPLOYEE
PRINT
Fullname OVER
LAST_NAME
FIRST_NAME
END


7.6.7
windows
PDF,EXCEL.
July 16, 2009, 03:40 PM
Darin Lee
Like I mentioned - you can make the column title whatever you want it to be with the AS statement.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 16, 2009, 03:42 PM
swati
MICROFICH,
I USED YOUR solution,it works,but small modification needed.
i altered the code as:
TABLE FILE EMPLOYEE
PRINT
LAST_NAME AS 'FULLNAME,LASTNAME'
FIRST_NAME AS 'FIRSTNAME'
END

now i want the full name in the center,it is displaying in the left for the above code.


7.6.7
windows
PDF,EXCEL.
July 16, 2009, 03:51 PM
swati
got it,thanks guys.


7.6.7
windows
PDF,EXCEL.
July 16, 2009, 04:09 PM
swati
HI,
for this code can i get a line of seperation between the full name and last name as i run this code it appears that full name is a part of the block belonging to last name,so i want a line of seperation for the full name and last name.
TABLE FILE EMPLOYEE
PRINT
LAST_NAME AS 'FULLNAME,LASTNAME'
FIRST_NAME AS 'FIRSTNAME'
END


7.6.7
windows
PDF,EXCEL.
July 17, 2009, 06:09 AM
Shruthi Joshi
May be you can try with the following code in which fullname is kept under page heading....

TABLE FILE EMPLOYEE
PRINT
LAST_NAME
FIRST_NAME
HEADING
"FULLNAME"
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=ON,
FONT='ARIAL',
SIZE=9,
$
ENDSTYLE
END

Hope it helps..........


WebFocus 7.6.8
Data Migrator 7.6.8
Windows XP
HTML,Excel
July 17, 2009, 09:07 AM
swati
shruthi,
you are including full name in the heading,thats fine.but,is there any way that i can omit the gap between the full name and column titles.i.e;i want the full name block exactly on top of the column titles.


7.6.7
windows
PDF,EXCEL.
July 17, 2009, 10:56 AM
Aneela
Hi Swati,
try this.

TABLE FILE EMPLOYEE
PRINT
LAST_NAME AS 'FULLNAME,,LASTNAME'
FIRST_NAME AS ',,FIRSTNAME'
END

You can also put the FULLNAME in the heading and use colspan in the style sheet to have it go across the last name and first name columns.


WebFocus 7.1.3
Developer studio 7.6.4
Windows
Excel, HTML and PDF
July 17, 2009, 05:57 PM
Doug
"colspan"... in PDF? It'll work in Excel and HTML... Not in PDF... You could use spot markers... You can move all your titles to the heading lines, and use spot markers or POSITION, so that it looks as though you eliminated the line between the HEADING and TITLEs. I've done this and it works... A bit of tedious development, but, it works...
July 18, 2009, 12:27 PM
Aneela
yep -- you're right wont work for pdf -- I thought it was html.


WebFocus 7.1.3
Developer studio 7.6.4
Windows
Excel, HTML and PDF
May 24, 2010, 03:51 PM
jwatkins
You can use borders to accomplish this.
TABLE FILE CAR
HEADING CENTER
"TEST"
" "
"Country <+0>Model"
PRINT
COUNTRY
CAR
MODEL IN +10
BODYTYPE
SEATS
SALES
ON TABLE SET STYLE *
TYPE=HEADING,LINE=3,OBJECT=TEXT,ITEM=1,POSITION=COUNTRY,$
TYPE=HEADING,LINE=3,OBJECT=TEXT,ITEM=2,POSITION=MODEL,$

TYPE=REPORT,COLUMN=COUNTRY,LEFTGAP=0,$
TYPE=REPORT,COLUMN=MODEL,LEFTGAP=0,$

TYPE=TITLE, COLUMN=COUNTRY,BORDER=LIGHT, BORDER-LEFT=OFF,BORDER-RIGHT=OFF, BORDER-BOTTOM=OFF,$
TYPE=TITLE, COLUMN=CAR,BORDER=LIGHT, BORDER-LEFT=OFF,BORDER-RIGHT=OFF,BORDER-BOTTOM=OFF, $

TYPE=TITLE, COLUMN=MODEL,BORDER=LIGHT, BORDER-LEFT=OFF,BORDER-RIGHT=OFF,BORDER-BOTTOM=OFF, $
TYPE=TITLE, COLUMN=BODYTYPE,BORDER=LIGHT, BORDER-LEFT=OFF,BORDER-RIGHT=OFF, BORDER-BOTTOM=OFF,$
ENDSTYLE
ON TABLE PCHOLD FORMAT PDF
END