Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]dynamic columns display

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]dynamic columns display
 Login/Join
 
Gold member
posted
HI

i have to display dynamic columns based on the selection of the user from front end,
the user can select the column thous column only i need to display the output in excel format

from front end selection the column is storing in one variable like below like that i have 50 column coming from front end

-SET &DIS_fld = 'FLD1','FLD2','FLD5','FLD8','FLD10';


TABLE FILE CAR
PRINT
-IF &DIS_fld CONTAINS 'FLD1' THEN DIS_COL11 ELSE NEXT_COL11
-DIS_COL11
COUNTRY AS TITLE_1
-NEXT_COL11
-IF &DIS_fld CONTAINS 'FLD2' THEN DIS_COL22 ELSE NEXT_COL22
-DIS_COL22
CAR AS TITLE_2
-NEXT_COL22
-IF &DIS_fld CONTAINS 'FLD3' THEN DIS_COL33 ELSE NEXT_COL33
-DIS_COL33
MODEL AS TITLE_3
-NEXT_COL33
-IF &DIS_fld CONTAINS 'FLD4' THEN DIS_COL44 ELSE NEXT_COL44
-DIS_COL44
BODYTYPE AS TITLE_4
-NEXT_COL44
-IF &DIS_fld CONTAINS 'FLD5' THEN DIS_COL55 ELSE NEXT_COL55
-DIS_COL55
WARRANTY AS TITLE_5
-NEXT_COL55
.
.
.
.
ON TABLE PCHOLD FORMAT EXCEL
END


Output to display like below

 TITLE_1     TITLE_2     TITLE_5     TITLE_8     TITLE_10   

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8202
 
Posts: 61 | Location: India | Registered: March 24, 2014Report This Post
Virtuoso
posted Hide Post
Hi Dev,

I would go with something like this:
  
-SET &ECHO=ALL;
-* File dev4.fex
-SET &DIS_FLD = 'FLD1,FLD2,FLD5,FLD8,FLD10';
-SET &DISLEN=&DIS_FLD.LENGTH;
-SET &FLDLEN=12;
-SET &I=0;
-REPEAT #GETFIELDS WHILE 1=1;
-SET &I=&I+1;
-SET &TOK=GETTOK(&DIS_FLD, &DISLEN, &I, ',', &FLDLEN, 'A&FLDLEN.EVAL');
-IF &TOK=' ' GOTO #XFIELDS;
-SET &FLD.&I=DECODE &TOK(
-            'FLD1'  'COUNTRY AS TITLE_1'
-            'FLD2'  'CAR AS TITLE_2'
-            'FLD3'  'MODEL AS TITLE_3'
-            'FLD4'  'BODYTYPE AS TITLE_4'
-            'FLD5'  'SEATS AS TITLE_5'
-            'FLD6'  'SALES AS TITLE_6'
-            'FLD7'  'RETAIL_COST AS TITLE_7'
-            'FLD8'  'DEALER_COST AS TITLE_8'
-            'FLD9'  'MPG AS TITLE_9'
-            'FLD10' 'RPM AS TITLE_10'
-            'FLD11' 'FUEL_CAP AS TITLE_11'
-  );
-#GETFIELDS
-#XFIELDS
-SET &MAXFLDS = &I - 1;
TABLE FILE CAR
PRINT 
-REPEAT #PFIELDS FOR &I FROM 1 TO &MAXFLDS;
&FLD.&I
-#PFIELDS
ON TABLE PCHOLD FORMAT HTML
END 


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Thank you


WebFOCUS 8202
 
Posts: 61 | Location: India | Registered: March 24, 2014Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]dynamic columns display

Copyright © 1996-2020 Information Builders