[SOLVED] How to create a date range slider filter in Webfocus
Hi Everyone,
As a part of our dashboard, I am trying to create a date range slider filter as shown in the url below. Please provide if you have any inputs on how to create this in webfocus. Thank you very much.
This message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
July 09, 2019, 12:37 PM
BI Dev
Hi Hallway,
Thanks for taking time to provide this information. I see a "slider" in components tool bar in the html composer. Is it possible to create a date range slider filter with this and pass date ranges to the procedures on the html page.
Regards BI DEV
Webfocus 8105/8202 Windows All Outputs
July 09, 2019, 02:32 PM
Hallway
quote:
Originally posted by BI Dev: Hi Hallway,
Thanks for taking time to provide this information. I see a "slider" in components tool bar in the html composer. Is it possible to create a date range slider filter with this and pass date ranges to the procedures on the html page.
Regards BI DEV
That slider control is only a single slider, not a range slider.
*Edit: Hold that thought. I see a multiple attribute on it. Looking into using dates and will update.
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
July 09, 2019, 03:51 PM
Hallway
I was able to make it work:
(ignore the black spot on the picture. I converted the picture to base64 so all can see it. However in the code there is the letter k repeated three times and IBI masks it as ***, which of course breaks the base64 data. #cuzIBI So, I had to change one of the k to l and that caused the black)
You need to change the slider attribute "range" to yes, and get the date values from a master file. I created a hold file from ggsales with just the distinct dates
TABLE FILE GGSALES
BY DATE AS 'DATEKEY'
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS baseapp/gg_dates FORMAT FOCUS
END
I then referenced the master file in the slider settings. The input box ends up being too small so I just changed the width on the embedded css tab
#slider1 > input {
width:130px;
}
/*the following code will put the input box inline with the slider*/
#slider1 > div {
width: calc(100% - 160px) !important;
}
This message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
July 10, 2019, 08:18 AM
MReeder
Hallway,
I have been working with the WebFOCUS slider range for a few now with techsupport help. Does the data range actually include the default range capabilities the way you are doing it?
Currently, the range does not have the capability to pass a default range of data. But if creating a hold file as you are doing with the dates will work for creating a default range of values, then maybe I can go that route too.
Thanks,
WebFOCUS 8.2.02M Windows Server/8.2.02M All Outputs
July 10, 2019, 03:45 PM
BI Dev
Thank you very much Hallway. It worked for me.
quote:
Originally posted by Hallway: I was able to make it work:
(ignore the black spot on the picture. I converted the picture to base64 so all can see it. However in the code there is the letter k repeated three times and IBI masks it as ***, which of course breaks the base64 data. #cuzIBI So, I had to change one of the k to l and that caused the black)
You need to change the slider attribute "range" to yes, and get the date values from a master file. I created a hold file from ggsales with just the distinct dates
TABLE FILE GGSALES
BY DATE AS 'DATEKEY'
ON TABLE SET ASNAMES ON
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS baseapp/gg_dates FORMAT FOCUS
END
I then referenced the master file in the slider settings. The input box ends up being too small so I just changed the width on the embedded css tab
#slider1 > input {
width:130px;
}
/*the following code will put the input box inline with the slider*/
#slider1 > div {
width: calc(100% - 160px) !important;
}
Webfocus 8105/8202 Windows All Outputs
July 10, 2019, 03:51 PM
Hallway
quote:
Originally posted by MReeder: Hallway,
I have been working with the WebFOCUS slider range for a few now with techsupport help. Does the data range actually include the default range capabilities the way you are doing it?
Currently, the range does not have the capability to pass a default range of data. But if creating a hold file as you are doing with the dates will work for creating a default range of values, then maybe I can go that route too.
Thanks,
Using the hold file, the range in the hold file will determine the range of the slider. the defaults will be the max and min values. I'm sure that you could set different default values with JavaScript.
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
July 10, 2019, 03:52 PM
Hallway
quote:
Can you please let me know how did you pass the date range from "date slider" to the report as a parameter.
Did you figure out how to pass the parameters to the report?
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
July 11, 2019, 06:55 AM
Tony A
quote:
new Date(new Date().toLocaleDateString());
Watch out if using this in IE versions.
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
July 11, 2019, 08:09 AM
Mike in DeLand
I'm trying this, but it doesn't seem to work correctly. When my screen comes up, the slider is populated properly, but when I move a slider I get numbers like 1996.1234 instead of dates. I'm on 8.105M.
Webfocus 8 Windows, Linux
July 11, 2019, 10:44 AM
MReeder
Hallway,
Thanks! I will give this a try.
WebFOCUS 8.2.02M Windows Server/8.2.02M All Outputs
July 11, 2019, 11:13 AM
Hallway
quote:
Originally posted by Tony A:
quote:
new Date(new Date().toLocaleDateString());
Watch out if using this in IE versions.
T
Interesting. Good catch. #ripIE
I guess that you would need this instead?
new Date(new Date().toDateString())
Our company has finally decided to give IE the boot and use designate Chrome and Edge-Chromium as our official browsers. This came about with the adivce from a MSFT rep stating at how vulnerable you are using IE. #happyDaysThis message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
July 11, 2019, 03:04 PM
MReeder
Hallway,
Thank you so much for this! It totally worked for my needs. Since I just needed a numeric range from 0-100 to default I was able to create a flat file and a table master off the file. Then just called the master from the dynamic call from the canvas.
I have a meeting set with Barry Solomon tomorrow at 1:00 pm est. He will be happy to be able to log this in his how to do that in WebFOCUS/App Studio.
Thanks again and have a great weeekend!
WebFOCUS 8.2.02M Windows Server/8.2.02M All Outputs
July 11, 2019, 04:02 PM
Hallway
NICE WORK!! I'm glad that you figured it out.
Don't forget to add [SOLVED] to the post title.
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
July 11, 2019, 04:40 PM
MReeder
is BI DEV solved? I sorta hijacked his post.
WebFOCUS 8.2.02M Windows Server/8.2.02M All Outputs
July 12, 2019, 09:32 AM
BI Dev
Yes, I was able to.
quote:
Originally posted by Hallway:
quote:
Can you please let me know how did you pass the date range from "date slider" to the report as a parameter.
Did you figure out how to pass the parameters to the report?
Webfocus 8105/8202 Windows All Outputs
July 12, 2019, 09:40 AM
BI Dev
Thank you very much Hallway, It worked for me. I appreciate everyone for taking time to provide their inputs.