Focal Point
Year Dropdown

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

February 12, 2008, 02:06 PM
arieger
Year Dropdown
I have a report which accepts a date parameter. The user can chose which date parameter they want to use with a drop down box. Currently the values in the drop down box are hard coded in

PRINT
INCIDENT_ID NOPRINT
LOGGED_DT AS 'Logged Date'
INCIDENT_ID AS 'Work Order ID'
DEPARTMENT_ID NOPRINT
BY HIGHEST LOGGED_DT NOPRINT
WHERE YEAR EQ '&YEAR.(<2008,2008>,<2007,2007>,<2006,2006>).Please select year.';

I want to set it up so that this report reads the systems current year and then adjust the following years accordingly. Now, I created three variable DATE_ONE which get the current date, DATE_TWO which gets current date - 1 Year, and DATE_THREE which get current date -2 years. Now the problem I am having is I want the values for these variables to display in the drop down. Not the variable name.
February 12, 2008, 03:01 PM
arieger
Signature:



Location: Texas
WebFOCUS 7.1.4
Platform/Operating System: WINXP
Output format - EXCEL, PDF, HTML
February 12, 2008, 04:55 PM
gregv
arieger:

If you hold your date fields (DATE_ONE DATE_TWO DATE_THREE) in format XML and assign your dropdown list to your procedure, you will see the values listed.

Make sure you have both a display field and value field for each item in the dropdown (ie. 20070101 Jan 1, 2007; 20080101 Jan 1, 2008; 20090101 Jan 1, 2009).

IHTH.



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
February 13, 2008, 05:10 AM
GamP
Arieger,

It sounds to me as if you rely on autoprompting for this.
If that is the case, then you're out of luck. Thing is, autoprompt reads and psearches the procedure before any processing within the procedure is done. The only things it will look for are unresolved parameters, and these will be propted for.
Best way to go for this is the way Greg indicated. Create an html page for the request with the html painter, create a separate procedure to populate the dropdown box, and bind this procedure to your dropdown control on the html page.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
February 13, 2008, 06:58 AM
Tony A
For amper autoprompting, if you use these three years regularly then why not write them to a table and have them accessable from your app path? Just have a single field within the table of YEAR format A4 for instance. You could write the years, that you want within the table, via overnight batch process (it would need to be populated before running a fex that needs it).

You could then just code something like this -

TABLE FILE GGSALES
SUM DOLLARS
    BUDDOLLARS
 BY REGION
 BY ST
 BY STCD
 BY CATEGORY
 BY PRODUCT
WHERE YEAR EQ &YEAR.(FIND YEAR IN YEARDATA).Please select year.;
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 14, 2008, 05:02 AM
GamP
Good solution Tony.
Looks as if this might work for him (or her).
I'll keep this trick in mind for whenever I need it.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988