Focal Point
Obtaining Field Description?

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

February 21, 2007, 12:25 PM
.eric
Obtaining Field Description?
Is there a way to get the field description onto the report?

I created a variable which is used for the sort order and would like to display that into the header. For instance our field name for item number is ITNO and I would like it to say Item Number instead.

I know I write some JSP to obtain the text from the display field of the dropdown but I was wondering if WebFOCUS has a way to do this.

Eric


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
February 21, 2007, 01:00 PM
FrankDutch
You should put that description in the master file
or when it is a local defined field you rename it by

PRINT
ITNO AS 'Item number'
etc

is this what you want?

Frank




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

February 21, 2007, 01:30 PM
Tom Flynn
Eric,

This is what Frank was referring to regarding the MASTER:

FILENAME=CAR,SUFFIX=FOC
SEGNAME=ORIGIN,SEGTYPE=S1
FIELDNAME=COUNTRY,COUNTRY,A10,FIELDTYPE=I,
TITLE='COUNTRY OF ORIGIN',$

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
February 22, 2007, 10:58 AM
.eric
Sorry I think I may have stated what I was looking for wrong. I was refering to putting it into the header and not the column titling.

The user has a dropdown for &DIMENSION which lets them sort by ITNO (Item NUmber), ITNM (Item name) ect and I need the Header to say "Item Number" if that is the &DIMENSION they selected.

So in the page header I have the following code:
Sort By: &DIMENSION

Which right now outputs:
Sort By: ITNO

Eric


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
February 22, 2007, 11:20 AM
Francis Mariani
I would either:

in the report: use Dialogue Manager and DECODE the &DIMENSION values ITNO, ITNM to &DIMENSION_NAME

or

in the HTML launch page: use JavaScript to pass both the document.forms[0].DIMENSION.options[DIMENSION.selectedIndex].text and document.forms[0].DIMENSION.options[DIMENSION.selectedIndex].value


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
February 22, 2007, 11:39 AM
.eric
I was actually thinking of using DECODE, but wanted to avoid that if there were a lot of values in the drop down, but this can work for now.

I already use JSP on some reports to do this but here I have to setup more variables to accomplish this.

Thanks guys,

Eric


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
February 22, 2007, 11:39 AM
Alan B
If you want this generalised for many fields, put the text you want for each field in the TITLE or HELPMESSAGE of the mfd. Then:
CHECK FILE Fn HOLD
TABLE FILE HOLD
PRINT HELPMESSAGE 
IF FIELD EQ &DIMENSION
ON TABLE SAVE
END
-RUN
-READ SAVE &HM.A30

You should be able to put this into a single -INCLUDE.


Alan.
WF 7.705/8.007
February 22, 2007, 12:14 PM
susannah
If its a small list, then in your fex:
-DEFAULT &BYFIELD = 'ITNO';
-SET &BYFIELDNAME=DECODE &BYFIELD
('ITNO' 'ITEM NUMBER'
'PROD' 'PRODUCT NAME'
'BRND' 'BRAND NAME' ELSE '');
then in your heading
HEADING
"sorted by &BYFIELDNAME "
...(nb: leave blank space before closing " )
or, if its a long list, then
you can do this with a decode file.
Make these decode files in advance and park them on your server in your apps directory , then you have them ready whenever you need them in any fex.
TABLE FILE something
SUM COMPUTE BLANK/A1=' '; CODENAME
BY CODE
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS DECODE01 FORMAT ALPHA
END
...now you can use this list in two ways
-DEFAULT &MYFIELD = '1234';
-SET &MYFIELDNAME=DECODE &MYFIELD(DECODE01);
or similarly in a define where you're putting some codename on every code field.
You should be good to go, now, .eric.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 22, 2007, 04:40 PM
.eric
Some good tips, thanks Alan and Susannah. I am just using the set/decode right now as there are only 5 options for this report. But your method for large lists should be helpful for the future.

Eric


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat