Focal Point
[CLOSED] Dynamic drop down

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

January 17, 2012, 01:05 PM
Venkat-
[CLOSED] Dynamic drop down
Greetings,

we are doing dynamic drop down for the terms in our institution. When running the file, the drop down begins with term Fall 1960, but the current term is Spring 2012. How do we make the drop down to show spring 2012 as "default" and when we go to next term it should change automatically in the parameter window to summer 2012. How can we do that? Any suggestions would be appreciated. Thanks.

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


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
January 17, 2012, 01:15 PM
cgiuda
Well, how about have your Value field be a different field from your display field and have the value field be formatted YYYY (ie: '2012 Summer') instead of YYYY. (Summer 2012) Then sort descending on the value field in the Properties and Settings.


WebFocus 8104, IBMi (server), Windows 7 (client), iWay 6.1
January 17, 2012, 01:36 PM
Venkat-
I can do the way like you said. But how the term in the drop down will change automatically when we go to summer 2012 and so forth next terms?

I already set the parameter to "Spring 2012" as default from the available drop down list (spring 2011, fall 2011, fall 2012, spring 2012, summer 2012, etc..). When we go to next term, it should automatically highlight summer 2012.

Please let me know. Thanks.


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
January 17, 2012, 03:31 PM
Tom Flynn
quote:

When we go to next term, it should automatically highlight summer 2012.


Not unless your code includes testing Today's Date against the Begin and End Date of the term.
This populates our List box and puts the current term at the top:
  
DEFINE FILE STVTERM
   START_DT/YYMD      = STVTERM_START_DATE;
   START_YR/YY        = DATEADD(START_DT, 'Y', -1);;
   END_DT/YYMD        = STVTERM_END_DATE;
   XEND_DT/YYMD       = DATEADD(END_DT, 'D', 14);
   XEND_YR/YY         = DATEADD(END_DT, 'Y', 1);
   XTODAY/YYMD        = &YYMD;
   X_TODAY_YR1/YY     = DATEADD(XTODAY, 'Y', -2);
   X_TODAY_YR2/YY     = DATEADD(XTODAY, 'Y',  3);
   FLAG1/A1           = IF XTODAY   GE START_DT    AND XTODAY  LE XEND_DT     THEN 'Y' ELSE 'N';
   FLAG2/A1           = IF START_YR GE X_TODAY_YR1 AND XEND_YR LE X_TODAY_YR2 THEN 'Y' ELSE 'N';
   DIFF/I5            = (DATEDIF(START_DT,XTODAY,'D') + 1) / 7;
   X_STVTERM_CODE/A6  = STVTERM_CODE;
   X_STVTERM_DESC/A30 = STVTERM_DESC;
   SHOW_TERM/A40      = X_STVTERM_CODE || ' - ' | X_STVTERM_DESC;
-*   XTERM/A100         = '<OPTION VALUE=''' || X_STVTERM_CODE ||  '''>'       || SHOW_TERM || '</OPTION>';
END
TABLE FILE STVTERM
SUM
    SHOW_TERM
   BY HIGHEST FLAG1 NOPRINT
   BY X_STVTERM_CODE
WHERE FLAG2 EQ 'Y';
 ON TABLE PCHOLD FORMAT XML
END
-RUN



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
January 18, 2012, 04:14 PM
Venkat-
Thanks Tom. I will try this code.


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
January 24, 2012, 06:56 PM
Venkat-
Tom, I tried the code but it wasn't working. I have the available drop down list in auto prompting window (fall 1960, spring 1960, summer 1960,....fall 2020, spring 2020, summer 2020) to let the user select the term. In the drop down, I see fall 1960 has been highlighting as the default term but I like to change this to current term (which is spring 2012). At the same time, when we go to july 2012 it should highlight summer 2012 automatically. When we go to august 2012 it should highlight fall 2012 and likewise for the rest. Any response to this would be greatly appreciated.


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
January 24, 2012, 09:52 PM
Dan Satchell
This link may help you: [Technique] Dynamically preselect items in chained combo boxes.

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05