Focal Point
[CLOSED] Define field data as column title

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

January 04, 2012, 06:53 PM
BI_Developer
[CLOSED] Define field data as column title
Hi

I have a DEFINE FIELD.
How can I use it a column heading to another field?

 

DEFINE FILE CAR
FLD_LBL/A100 = 'F1' | CAR | 'NAME';
END

PRINT
CAR AS 'LABEL'
END

 


In place of LABEL I am trying to get data from FLD_LBL

Thank you

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


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
January 04, 2012, 07:05 PM
Waz
One method is to use the field in the heading.

e.g.
DEFINE FILE CAR
FLD_LBL/A100 = 'F1' | CAR | 'NAME';
END

TABLE FILE CAR
HEADING
" "
"COUNTRY<FLD_LBL"
PRINT
COUNTRY AS ''
CAR AS ''
ON TABLE SET STYLE *
 TYPE=HEADING, HEADALIGN=BODY, $
ENDSTYLE
END



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 04, 2012, 11:56 PM
<FreSte>
Another method that can be used is ( See this post)

TABLE FILE CAR
  SUM
    COMPUTE TMP/A100 = 
      'COMPUTE ''' | COUNTRY || '''/D12S = IF COUNTRY EQ ''' ||  COUNTRY  || ''' THEN SEATS ELSE 0;';
  BY COUNTRY NOPRINT
  ON TABLE SET HOLDLIST PRINTONLY
  ON TABLE HOLD AS HLDCTRY FORMAT ALPHA
END
-RUN

TABLE FILE CAR
  PRINT
-INCLUDE HLDCTRY
BY CAR
END


-Fred-
January 05, 2012, 01:17 PM
Crymsyn
Another way if there is more than on heading value is to use ON CAR SUBHEAD

 DEFINE FILE CAR
FLD_LBL/A100 = 'F1' | CAR | 'NAME';
END
TABLE FILE CAR
BY CAR AS ''
ON CAR SUBHEAD
"<FLD_LBL"
END 


Another way if it stays the same can use parameters. It will not change though when CAR changes since it only reads the first row value in this case.

 TABLE FILE CAR
PRINT 
COMPUTE FLD_LBL/A100 = 'F1' | CAR | 'NAME';
ON TABLE HOLD AS CARHEADING
END
-RUN
-READ CARHEADING &CAR_HEADING.A100

TABLE FILE CAR
PRINT
CAR AS '&CAR_HEADING'
END 



WF: 8201, OS: Windows, Output: HTML, PDF, Excel
January 05, 2012, 06:01 PM
Doug
Just a thought: You should be able to HOLD the data (real or DEFINEd fields) you want to use as TITLEs from your source tables and -READ them into "TitleVariables" which will be used as your TITLEs in your report.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206