Focal Point
[SOLVED] - Title Case in Column Headers

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

August 10, 2011, 12:42 PM
ColdWhiteMilk
[SOLVED] - Title Case in Column Headers
Is there a way from the "ON TABLE SET STYLE *" section to force the column headers in a report to be appear in "Title Case" instead of "ALL CAPS"?

If so, can this be set for specific columns only?

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


Production - 7.6.4
Sandbox - 7.6.4
August 10, 2011, 02:31 PM
Prarie
You can do this with AS

TABLE FILE CAR
PRINT CAR AS 'Car'
END
August 10, 2011, 02:54 PM
ColdWhiteMilk
Sorry, I should have posted my code so that you could see why I need to do this in the stylesheet. I need to run the first part this way to get all of the column headers on the same line (the ACROSS column headers appear one line up from the rest). So when I do the PRINT * for the second part, it gives me all of the BY fields, and all of the ACROSS fields, but the ACROSS fields are just the field names from the hold file, even if I give them an alias.

TABLE FILE LIFECYCLEA
SUM
ROWTOT AS ''

BY FIELDA AS 'FIELDA'
BY FIELDB AS 'FIELDB'
BY FIELDC AS 'FIELDC'
BY FIELDD AS 'FIELDD'

ACROSS REJECTER
ACROSS-TOTAL AS 'TOTAL'

ON TABLE SET ASNAMES ON
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT *

ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT



Production - 7.6.4
Sandbox - 7.6.4
August 10, 2011, 03:39 PM
Mighty Max
How about redefining the ACROSS field and using LCWORD?

  
DEFINE FILE CAR
COUNTRY_MIX/A100 = LCWORD(10, COUNTRY, COUNTRY_MIX);
END

TABLE FILE CAR
SUM  DEALER_COST AS ''

BY CAR   AS 'FIELDA'
BY MODEL AS 'FIELDB'
ACROSS COUNTRY_MIX
ACROSS-TOTAL AS 'TOTAL'
ON TABLE SET ASNAMES ON
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT *
-*ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
August 10, 2011, 03:56 PM
ColdWhiteMilk
It is the "BY" fields that I can't get their column header to change to Title Case.


Production - 7.6.4
Sandbox - 7.6.4
August 10, 2011, 04:12 PM
Mighty Max
How about redefining the BY fields?
  
DEFINE FILE CAR
COUNTRY_MIX/A100 = LCWORD(10, COUNTRY, COUNTRY_MIX);
Car/A16 = CAR;
Model/A24 = MODEL;
END

TABLE FILE CAR
SUM  DEALER_COST AS ''

BY Car
BY Model
ACROSS COUNTRY_MIX
ACROSS-TOTAL AS 'Total'
ON TABLE SET ASNAMES ON
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT *
-*ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT

Or you could add a TITLE to the fields in the master?
  
FIELD=CAR, ALIAS=CAR, FORMAT=A16, TITLE='Car',$  



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
August 10, 2011, 04:22 PM
Mighty Max
The ASNAMES are staying all caps. Right?
Here is the syntax from the help file.
SET ASNAMES = [ON|OFF|MIXED|FOCUS]

So it looks like you need to do a
ON TABLE SET ASNAMES MIXED


I'm on 7.7.02 so I don't if this is avaialble in your version of Dev Studio.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
August 10, 2011, 04:26 PM
Mighty Max
Here is the sample
  
TABLE FILE CAR
SUM  DEALER_COST AS ''

BY CAR   AS 'Field1'
BY MODEL AS 'Field2'
ACROSS COUNTRY
ACROSS-TOTAL AS 'Total'
ON TABLE SET ASNAMES MIXED
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT *
-*ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
August 10, 2011, 06:31 PM
Waz
quote:
ON TABLE SET ASNAMES MIXED



You learn something new everyday.

Good One


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!

August 11, 2011, 09:02 AM
ColdWhiteMilk
Perfect! That is exactly what I needed.

Thank you.


Production - 7.6.4
Sandbox - 7.6.4
August 11, 2011, 09:56 AM
Prarie
Oh you do learn something new everyday.

Thanks