Focal Point
[CLOSED] Displaying Current Month in the Prompt

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

June 17, 2014, 06:41 AM
Smanicka
[CLOSED] Displaying Current Month in the Prompt
Hi,

I have a requirement to display the current_month in the Month Prompt. How do I achieve this in dashboard?

Thanks,
Smanicka

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.0.07
Windows, HTML
June 17, 2014, 06:50 AM
diogopc
Hi Smanicka,

In the HTML Composer, if you check View -> Properties and Settings and then click on your Month Prompt you get a bunch of settings regarding the prompt, see if that solves your problem.


WebFOCUS App Studio 8103
Windows7
All outputs
June 17, 2014, 08:59 AM
Ram Prasad E
You can create an onload event and control current month selection using javascript.

Thanks,
Ram


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
June 18, 2014, 09:17 AM
Smanicka
Hi Ram,

Could you please send me the sample javascript code for displaying the current-month in the prompt.

The Month Prompt is actually designed as follows

TABLE FILE F_WTC_CUSTOMER_PROFITABILITY_REPORT
SUM FST.F_WTC_CUSTOMER_PROFITABILITY_REPORT.V_D_MONTH.FY_MONTH_DESC // Display Field
BY F_WTC_CUSTOMER_PROFITABILITY_REPORT.V_D_MONTH.FY_MONTH_KEY // Value Field
// TODO: Add your filters here to replace defaults
ON TABLE PCHOLD FORMAT XML
END

Note:
  • Sample Values:
    FY_MONTH_DESC - January,February..
    FY_MONTH_KEY - 201401,201402..
  • ComboBox control is used for Month Prompt

    Thanks,
    Saranya M

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


  • WebFOCUS 8.0.07
    Windows, HTML
    June 19, 2014, 02:36 AM
    Dave
    Don't use javascript.

    You're on the right track.

    You've already got a .fex that outputs XML.

    In the HTML composer. Goto to the Parameter screen ( tab ).

    Right click the control and go to properties. Set it to "Dynamic" and choose to use a external procedure. The select the .fex with the above mentioned code and you're done.


    I know, people are going to complain about me saying "Don't use javascript". But I think it's a far better choice to use a fex. You have much more control and the ability to use data from your RDMS.

    G'luck.


    _____________________
    WF: 8.0.0.9 > going 8.2.0.5
    June 19, 2014, 06:39 AM
    Ram Prasad E
    Hi,

    You need to place HIGHEST keyword in TABLE FILE request to get the current month.
    TABLE FILE F_WTC_CUSTOMER_PROFITABILITY_REPORT
    SUM FST.F_WTC_CUSTOMER_PROFITABILITY_REPORT.V_D_MONTH.FY_MONTH_DESC // Display Field
    BY HIGHEST F_WTC_CUSTOMER_PROFITABILITY_REPORT.V_D_MONTH.FY_MONTH_KEY // Value Field
    // TODO: Add your filters here to replace defaults
    ON TABLE PCHOLD FORMAT XML
    END
    


    Thanks,
    Ram


    WebFOCUS 8.1.05
    Windows
    http://ibiwebfocus.wordpress.com
    https://www.facebook.com/groups/ibi.webfocus/
    June 19, 2014, 12:41 PM
    Smanicka
    Ram,

    I tried the solution which you have provided.It displays the highest month_key i.e "December" instead of current month.


    Thanks,
    Saranya


    WebFOCUS 8.0.07
    Windows, HTML
    June 20, 2014, 03:03 AM
    Ram Prasad E
    Hi,

    You need to restrict with a WHERE clause like below.

    WHERE FY_MONTH_KEY LE &YYYYMM;
    END

    If your requirement is to have current month selected in the list box along with having future months, then you need try with something like below. You can also use JS to control it.

    [CODE]

    TABLE FILE F_WTC_CUSTOMER_PROFITABILITY_REPORT
    SUM
    FST.F_WTC_CUSTOMER_PROFITABILITY_REPORT.V_D_MONTH.FY_MONTH_DESC // Display Field NOPRINT
    COMPUTE LIST_SELECT/A200=IF FY_MONTH_KEY EQ &YYYYMM THEN '' ELSE '';
    BY HIGHEST F_WTC_CUSTOMER_PROFITABILITY_REPORT.V_D_MONTH.FY_MONTH_KEY // Value Field NORPINT
    ON TABLE HOLD AS H_LIST_BX_1 FORMAT HTMTABLE
    ON TABLE SET HOLDLIST PRINTONLY
    END
    -RUN

    -HTMLFORM BEGIN
    < HTML>
    < BODY>
    < SELECT NAME=LIST_BX_1 ID=LIST_BX_1>
    !IBI.FIL.H_LIST_BX_1;
    < /SELECT>
    < /BODY>
    < /HTML>
    -HTMLFORM END

    [CODE]

    Thanks,
    Ram


    WebFOCUS 8.1.05
    Windows
    http://ibiwebfocus.wordpress.com
    https://www.facebook.com/groups/ibi.webfocus/