As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a question regarding finding out the format of the user entered date. The user has to provide the Begin Date and the End Date for the report. The users dont want to be restricted to enter the dates in a particular format. Is there a way using which we can find out the format of the dates the user enters. As these dates are being used as filters, finding out the format is critical.
Thanks for your time.This message has been edited. Last edited by: Kathleen Butler,
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
i don't know of any functionality that enables this short of EDITing out portions of the date and testing for a range of acceptable values (i.e. month token is between 1-12, Day token is not > 31). This has obvious drawbacks for dates where the day is <= 12.
The obvious solution is to use a calendar control and an HTML launch page to enforce the value selected. The calendar control brings its own bag of hurt with it, though.
I know of the EDIT function, but as I dont know the exact format being entered, I would have to come up with all the possible combinations and keep on checking with them till the exact one is met. As you said, the calendar control might be the only option.
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
I've done it. All you need to do is to account for ALL The Possibilities that the user can enter. Consider the following code:
-SET &DateIn = &DATEMDYY ;
-SET &DateIn = &MDYY ;
-TYPE *** Incoming date: &DateIn, check to see if it has slashes...
-SET &Slash = IF &DateIn CONTAINS '/' THEN 'Slashes' ELSE 'NoSlashes' ;
-TYPE *** -GOTO &Slash
-GOTO &Slash.EVAL
-Slashes
-TYPE Do something about the date with slashes
-GOTO TheEnd
-NoSlashes
-TYPE Do something about the date without slashes
-GOTO TheEnd
-TheEnd
-TYPE *** Ta Da
-EXIT
... You can use the EDIT and associated DM commands to limit it to accept only those dates which YOU want to accept and consider the rest as an erroneous input and act (branch) accordingly...
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
Currently there are no set rules for the date formats to be entered. I will have a talk with my users and ask them to give me their most commonly used formats for dates. Based on them, I will use the EDIT function and extract the dates.
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
Thanks a lot for the sample code. I plan to ask my users for a limited set of acceptable formats and based on them extract the dates and use them in the filters.
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
After many clients and and struggling with this for a few years, I try to talk each client into using the calendar control, with the edit box disabled. It is THE ONLY way to make absolutely sure the user does not type in an erroneous date.
This is the code I use for two calendar controls, defaulting to a 1 week date range, and producing a YYMD formated value to send to the report:
Thanks a lot for the detailed reply and posting your code. Will try it out. I still will talk to my users for a list of acceptable formats to avaoid any furhter confusion.
WebFOCUS 7.7.02Windows Output Formats: Excel, HTML, PDF
Oh Calandar controls is the only way to go. Think about any Web sites you go to that involves dates...they always have a calendar there. Can you imagine an airline trying to accommodate every way a person would put in a date?
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
if you have a text box, then in the html, set the maximum length to, say, 8 and populate the default value in the text box value=yyyymmdd and that exact character string, yyyymmdd, will appear in the box when the user opens the launch page. the user ought to be able to figure it out. or.. use 3 text boxes: year, month, day they can't possibly get that wrong. (oh ok, they can!)
btw... can one of you 77'ers tell me if the calendar controls have been improved? in 76, the calendar only popped up within the calling frame, and that never works for me, so i either use external .js for my calendar (tiger comes to mind), or i use dropdown boxes. but if 77 has fixed that so that the calendar will pop up wherever you tell it to, i'ld love to know....This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Originally posted by susannah: if you have a text box, then in the html, set the maximum length to, say, 8 and populate the default value in the text box value=yyyymmdd and that exact character string, yyyymmdd, will appear in the box when the user opens the launch page. the user ought to be able to figure it out. or.. use 3 text boxes: year, month, day they can't possibly get that wrong. (oh ok, they can!)
+1 - Unless you are a consultant who has to do the bidding of the person paying your fee or maintain an externally focused site that you don't wish to turn people (and their money) away, I'd suggest showing the user's the format expected and let them decipher the needs.
I can yell at my TV all day long for not changing channels when I press the volume buttons and as developers, we should not be expected to 'intercept' their intentions. Only judge their actions.