Focal Point
[CLOSED] Two columns with one column title

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

January 21, 2009, 10:50 AM
kfr104
[CLOSED] Two columns with one column title
I have done some searching but could not find the solution for this. I maybe searching for the wrong keywords.

I have to columns next two each other and I want them to share one column title. How can I do that?

Thanks,

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


WebFocus 7.6.4
SQL
HTML and Excel
January 21, 2009, 10:53 AM
GinnyJakes
Make the text a heading or subheading and use POSITION in the stylesheet to position the title starting at the first column.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 21, 2009, 11:09 AM
kfr104
If I put it in as a heading or subheading it will show up on a seperate line in excel...

Thanks,


WebFocus 7.6.4
SQL
HTML and Excel
January 21, 2009, 11:19 AM
nubi
and you do want the two cells that would have been used in excel for the column titles merged?


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
January 21, 2009, 11:37 AM
kfr104
Yes...

Thanks,


WebFocus 7.6.4
SQL
HTML and Excel
January 21, 2009, 11:48 AM
Darin Lee
In order to truly get what you are looking for, Ginny's suggestion is about the only way. If you want them all on one line, then you have to put all the column titles in the heading/subheading. Check out "Aligning a Heading or Footing Element Across Columns in an HTML Report" in the Creating Report with WF Language Manual.

There isn't a way to share a column title straight-up. You also may be able to create something that appears correctly by creating an compoud report with an empty report at the beginning containing the columns as you want them to appear and then a second report with the data on it without column titles, headings, etc.


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
January 21, 2009, 11:58 AM
Francis Mariani
Here's an example of what you're looking for created with the Dev Studio GUI. Look for HEADALIGN and COLSPAN.

TABLE FILE CAR
PRINT 
     COUNTRY
     CAR
     MODEL
     BODYTYPE
     SEATS
     LENGTH
     WIDTH
HEADING
"Country<+0>Car<+0>Model<+0>Body Type<+0>Seats<+0>Dimensions"
FOOTING
""
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,
     HEADALIGN=BODY,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     COLSPAN=1,
     JUSTIFY=LEFT,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=2,
     COLSPAN=1,
     JUSTIFY=LEFT,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=3,
     COLSPAN=1,
     JUSTIFY=LEFT,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=4,
     COLSPAN=1,
     JUSTIFY=LEFT,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=5,
     COLSPAN=1,
     JUSTIFY=RIGHT,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=6,
     COLSPAN=2,
     JUSTIFY=CENTER,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
     SIZE=9,
$
TYPE=ACROSSTITLE,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,
$
ENDSTYLE
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 21, 2009, 12:07 PM
ChannyS
Using Francis's code - if you don't want two lines of column titles then shut off the original column titles:

COUNTRY AS ''
CAR AS ''
MODEL AS ''
BODYTYPE AS ''
SEATS AS ''
LENGTH AS ''
WIDTH AS ''

Or you could mix and match - depending on what you'd like to show on your report.


Release: WebFOCUS 7.6.8
OS: Windows
Output formats: HTML, PDF, Excel, csv
January 21, 2009, 01:24 PM
Francis Mariani
Sorry, of course I should have done that. Thanks.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 21, 2009, 07:55 PM
susannah
i cheat ...
i right adjust the first column title
and left adjust the second column title
eg:
In the first column title i put 'Net'
and in the second column title i put 'Income'
then i use some nice background color, or font color , or borders, or some other style techniques to make these two columns look like 1 entity..
works.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 21, 2009, 08:24 PM
Waz
I think this should be put into IBI as an NFR (New Feature Request)

How many of us have come across a request for a report where 2 columns have one heading ?


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!

January 21, 2009, 09:03 PM
ChannyS
Even more...

Each column having it's own unique heading but a group having a group heading. (Francis's technique would allow for this but it would be nice to allow it out of the box).

For example:
 
--------------------------------------------------
        Financial         |         Body         |
--------------------------------------------------
Retail Cost | Dealer Cost | Seats | MPG | Height |   
--------------------------------------------------


And also the ability to have column titles print AFTER a subhead. That one really kills.


Release: WebFOCUS 7.6.8
OS: Windows
Output formats: HTML, PDF, Excel, csv
January 22, 2009, 04:09 AM
nubi
quote:
Originally posted by susannah:
i cheat ...


i think this is the best way personally, i can't understand why you would want a shared coloumn title in excel for anything other than display purposes as it wont let you filter or sort those two columns once you merge the title cells and really the only reason our team outputs to excel is so the end user can manipulate the data.


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
January 22, 2009, 09:06 AM
Guy
Does this do what you want?

DEFINE FILE CAR
acolumn/A20='my column heading';
END
TABLE FILE CAR
SUM
LENGTH
WIDTH
BY MODEL
ACROSS acolumn
WHERE RECORDLIMIT EQ 500
ON TABLE NOTOTAL
END


WebFOCUS 7.6.4
Windows XP against an Oracle Database mainly SCT Banner Higher Education ODS and EDW
Various output formats


Guy Brenckle
Budget Analyst
University of Northern Colorado
January 22, 2009, 10:17 AM
Francis Mariani
nubi,

"i can't understand why..." - actually I get a lot of requests to set up column titles like ChannyS example. I am perfectly happy using HEADING and HEADALIGN and POSITION, etc to achieve that.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 22, 2009, 03:31 PM
Waz
I too have many requests, just line the example, and yes you can do it as Francis suggests, but wouldn't it be easier with standard FOCUS code.

What is worse is when they want borders and/or back colours.


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!

January 22, 2009, 04:38 PM
FrankDutch
quote:
And also the ability to have column titles print AFTER a subhead. That one really kills.


I support this...

and also more ideas about the headings.

Also Guy's suggestion is a simple solution that works well in HTML. I do not know how it acts with excel.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 23, 2009, 02:30 AM
nubi
quote:
Originally posted by Francis Mariani:
nubi,

"i can't understand why..." - actually I get a lot of requests to set up column titles like ChannyS example. I am perfectly happy using HEADING and HEADALIGN and POSITION, etc to achieve that.


im sure you do; it just seemed a bit counterintuitive in the context of the way we work, many reports of ours with merged cells often gets a customer request at some stage to remove them and make it easier to manipulate-and we use a lot of Dialogue Manager to remove merged cells from the report if they select the excel output...


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
January 23, 2009, 06:45 AM
ChannyS
quote:
Originally posted by FrankDutch:
quote:
And also the ability to have column titles print AFTER a subhead. That one really kills.


I support this...

and also more ideas about the headings.

Also Guy's suggestion is a simple solution that works well in HTML. I do not know how it acts with excel.


Another one (especially since we sometimes have to put column titles as the last row of subheads since the titles only show up before subheads...):
The ability to put borders/grids around elements of a heading/footing. This one kills too!!!


Release: WebFOCUS 7.6.8
OS: Windows
Output formats: HTML, PDF, Excel, csv
October 18, 2012, 04:45 PM
ReddyP
I need the same format as this.
I was able to get the column titles but, I am not able to get the borders around the heading for each individual item. What is the best way to do this?

quote:
--------------------------------------------------
Financial | Body |
--------------------------------------------------
Retail Cost | Dealer Cost | Seats | MPG | Height |
--------------------------------------------------


Thank you.


7.7.01,windows2008 R2