Focal Point
How to display a comma in a column title

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

May 04, 2007, 09:37 AM
thangam
How to display a comma in a column title
Is it possible to insert a comma in cloumn titles? In general a comma is used to span the title across lines but if we need to display a comma as such in the column titles, is there any escape character which can be used?
May 04, 2007, 09:59 AM
smiths
Here's a simple example:

-SET &XTITLE = 'AUTO' | '&|#44;' | 'MOBILE';

TABLE FILE CAR
PRINT
CAR AS &XTITLE
BY COUNTRY
END


Regards,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
May 04, 2007, 10:10 AM
mgrackin
thangam,

If you are displaying the report in HTML you can use the HTML Number for a comma ',' in the title. The key is to put the pipe symbol '|' after the '&' symbol.

TABLE FILE CAR
PRINT COUNTRY AS 'The&|#44;Country'
ON TABLE PCHOLD FORMAT HTML
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
May 07, 2007, 09:42 AM
thangam
Hi,
Thanks for the solution you people have given.
But this is working only when the "as" name is applied to a direct measure from a table or cube. When I alias a compute variable with the ASCII value of a comma it gives an error.

One more thing is that, this is working fine only in HTML and Excel. In PDF it just shows the whole string along with '&|#44' in the column title instead of displaying a comma.

Any solutions for the above issues please?
May 07, 2007, 10:32 AM
mgrackin
Thangam,

You are correct that this does not work for COMPUTEs. Very interesting. I did not know that.

My suggestion is to use SUBHEADs to create the column titles instead of trying to force the AS phrase to include commas. This is a lot easier to deal with the comma.

Here is an example which will work for HTML, EXL2K and PDF:

TABLE FILE CAR
PRINT
COMPUTE ABRV/A4=EDIT(COUNTRY,'9999'); AS ''
CAR AS ''
BY COUNTRY AS ''
ON COUNTRY SUBHEAD
"The,Country<+0>The,Abreviation<+0>The,CAR"
ON COUNTRY SUBFOOT
""
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=COUNTRY, WRAP=1.5,$
TYPE=REPORT, COLUMN=CAR , WRAP=1.5,$
TYPE=REPORT, COLUMN=ABRV , WRAP=1.5,$
TYPE=SUBHEAD, HEADALIGN=BODY,$
TYPE=SUBHEAD, LINE=1, OBJECT=TEXT, ITEM=1, POSITION=P1,$
TYPE=SUBHEAD, LINE=1, OBJECT=TEXT, ITEM=2, POSITION=P2,$
TYPE=SUBHEAD, LINE=1, OBJECT=TEXT, ITEM=3, POSITION=P3,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
May 07, 2007, 10:35 AM
FrankDutch
In PDF We have more problems with extended characters.

If I make a compound report with a graph that has the Euro symbol it gives me not what I want.




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

May 08, 2007, 06:38 AM
<JJI>
Thangam,

I think, I have a very simple solution for your problem. This code works for a define, compute in html, excel and most important in PDF!!!

  
-SET &XTITLE = 'AUTO' | '&|#44;' | 'MOBILE';
DEFINE FILE CAR
AUTO,MOBILE/A20 = CAR;
END

TABLE FILE CAR
PRINT
CAR AS &XTITLE
AUTO,MOBILE
COMPUTE MOBILE,AUTO/A20 = CAR ;
BY COUNTRY
ON TABLE SET ONLINE-FMT PDF
END


As you can see it is very simple. Just put the ',' in the name of your defined or computed field and voila.

Hope this helps,

This message has been edited. Last edited by: <JJI>,
May 08, 2007, 09:00 AM
mgrackin
Dirk,

Very nice solution. It definitely works but it makes me nervous using commas in the names of fields. Eeker


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
May 08, 2007, 09:28 AM
Francis Mariani
It happens to be the documented method:

TECHNIQUE - How to have a column title display a comma?


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
May 08, 2007, 09:38 AM
mgrackin
Well I have now learned my new thing for today. This sounds like a good Tip & Tech to share at Summit. I never knew about this. The information on Tech Support really brings it to the extreme with commas AND spaces AND a dollar sign in the field name.

Thanks for the link Francis.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
May 08, 2007, 09:48 AM
Francis Mariani
Though, like you, I'm scared to jump in!


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
May 08, 2007, 04:16 PM
<JJI>
Mickey, Francis,

Sorry, but I didn't knew this was documented. I found this solution some time ago by accident. But I remembered it when I saw this post and wanted to share it.

Your right it's not the finest coding, but it's working. Smiler
I'm glad I could help. Winky