[CLOSED] Pass a variable into Slide Control Filter
I need to be able to make a selection of locations to display in a Top/Bottom table. We have different clients who will use this tool so it needs to change based on how many locations they have. For instance, a client with 40 locations should be able to slide from 1 to 20. A client with 60 locations would be 1-30. I can't find a way to pass that in variable form. This is how the filter is coded.
WHERE &VarCnt.(FROM 1 TO 10).Variance Count:. GE 1;
I also have a hold file that will look for locations based on the client logged in and store another variable that is half the count of locations.
TABLE FILE DIMLOCATION
SUM
COMPUTE LocCnt/I4=CNT.LocationID/2;
ON TABLE HOLD AS LOC FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
ENDSTYLE
END
-RUN
-SET &LocCnt = 10;
-READFILE LOC
TYPE LocCnt = &LocCnt
If I insert &LocCnt into the Where statement,
WHERE &VarCnt.(FROM 1 TO &LocCnt).Variance Count:. GE 1;
the filter just reads it as 0. So the slider is a range of 1 to 0 which obviously doesn't do anything. I've tried it with '&LocCnt' and with "&LocCnt" and get the same result. Is it possible?This message has been edited. Last edited by: FP Mod Chuck,
WebFocus 8207 Windows 10 Excel, HTML
May 21, 2020, 11:23 AM
MartinY
May not be the best option, but since I don't know all your code in the filter, can it work using something such as below ?
-IF &LocCnt LE 10 THEN GOTO WHR10;
-IF &LocCnt LE 20 THEN GOTO WHR20;
-IF &LocCnt LE 30 THEN GOTO WHR30;
...
-*-* If none of above IF is true, then perform below as default
-WHR10
WHERE &VarCnt.(FROM 1 TO 10).Variance Count:. GE 1;
-GOTO ENDWHR
-WHR20
WHERE &VarCnt.(FROM 1 TO 20).Variance Count:. GE 1;
-GOTO ENDWHR
-WHR30
WHERE &VarCnt.(FROM 1 TO 30).Variance Count:. GE 1;
-GOTO ENDWHR
...
-ENDWHR
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
May 21, 2020, 11:54 AM
Matthew S
I appreciate the response, but the issue isn't getting the right number of locations to show up. I need the filter at the top to go from 1 - X. It will vary quite a bit depending on client so trying to make a separate GOTO for each possibility would be way to cumbersome.
Edit: also how do I get images to show up? I've tried imgur and imgBBThis message has been edited. Last edited by: Matthew S,
WebFocus 8207 Windows 10 Excel, HTML
May 21, 2020, 12:11 PM
FP Mod Chuck
Matthew
It is not clear where &VarCnt is being set and your WHERE should just be WHERE &VarCnt FROM 1 to &LocCnt without the GE 1. I created a similar report with the car file and used a slider in the html form and it works fine, granted I am using a real field for the WHERE.
TABLE FILE CAR
SUM
CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
WHERE CAR.BODY.SEATS FROM 1 TO &SEATS;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,
$
ENDSTYLE
END
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 21, 2020, 12:36 PM
Matthew S
Thanks but the issue isn't actually filtering the data. I need the control at the top to be a slider. The example you provided created a simple filter box where the user inputs a number. I don't want the user to input any number. I want them to select from within range I provide. Here's an example from the manual for 8205 for working slider controls:
Except in the above image, I need the range to be (FROM 1 to &LocCnt) instead of a hard coded number.
WebFocus 8207 Windows 10 Excel, HTML
May 21, 2020, 12:42 PM
FP Mod Chuck
Matthew
I created an html formwith a slider control for the variable not an edit box and when I move the slider it filters the report accordingly.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
May 21, 2020, 02:22 PM
Matthew S
I'm not getting that result when I use
TABLE FILE CAR
SUM
CAR.BODY.DEALER_COST
BY CAR.ORIGIN.COUNTRY
BY CAR.COMP.CAR
WHERE CAR.BODY.SEATS FROM 1 TO &SEATS;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,
$
ENDSTYLE
END
I just get an edit box. Is there additional coding I need to apply?
WebFocus 8207 Windows 10 Excel, HTML
May 21, 2020, 02:29 PM
FP Mod Chuck
Matthew
You have to create a separate html form and reference the fex. It will prompt you for what kind of control you want and choose slider.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats