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 am passing a date formatted (MDYY) variable from an HTML page to a report. How can I test the report to see the format of the variable being passed? For simplicity sake I am using this code:
-DEFAULTH &DT = _FOC_NULL; -SET &DT = IF &DT NE _FOC_NULL THEN &DT ELSE CLAIMS.FROM_DT;
TABLE FILE CLAIMS PRINT -* This NOPRINT is only here for the report to show properly. No calculatiosn are being done on it. CLAIMS.FROM_DT NOPRINT COMPUTE TM/MDYY = &DT; END
It works if I just run it, but if I used the FROM_DT field in a combobox on the HTML page, and pass it to the report as &DT (via a Run Button) it doesn't work. I can't for the life of me figure out why it would work one way and not the other depending on where the variable is set.This message has been edited. Last edited by: FP Mod Chuck,
John Coleman WEBFocus 8.1.05 Windows 7
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016
I am not using a calendar control. I am passing it from a combobox filled in dynamically by that field in the Master so &DT being passed should be the MDYY that the field is in the master, no?
John Coleman WEBFocus 8.1.05 Windows 7
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016
In the properties of your combobox, make sure it is sent as a quoted value.
It is possible that the value being sent is an alphanumeric representation of your date (variables do not have a real format) such as 08/19/2019, which will not pass the compute that you have.
If you make your page send it as a quoted value, '08/19/2019', it should be dealt with correctly.
You could test this (or use the code!) like this -
-SET &DT = IF &DT NE _FOC_NULL THEN '''' || &DT || '''' ELSE DATE;
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
I am not using a calendar control. I am passing it from a combobox filled in dynamically by that field in the Master so &DT being passed should be the MDYY that the field is in the master, no?
Is it the USAGE or the ACTUAL that is MDYY ?
And once passed from a parameter, in a sense, it all become either a text or a number depending if it includes characters or not
If you add this at the top of your fex that receive the parameter, what do you see ?
-TYPE Received Dt : &DT -EXIT
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
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
That leads me to assume it Alphanumeric, since it has "/" in it. That doesn't explain how if I just set it to the field via the IF...THEN... statement, it works.
I really want to see what the format is coming from the HTML, can I use the ?FF on something being passed into the report?
I'm trying to understand the conversion I am missing, so forgive me if I seem obstinate.This message has been edited. Last edited by: John Coleman,
John Coleman WEBFocus 8.1.05 Windows 7
Posts: 20 | Location: Rensselaer, NY | Registered: May 20, 2016
The date display depend on your configuration under Reporting Server / Workspace / LOCALE / LOCALE (Language, Numbers, Currency, Dates) / - DATE_ORDER - DATE_SEPARATOR
-DEFAULTH &DT = 08/01/2019;
DEFINE FILE CAR
TM/MDYY = &DT.QUOTEDSTRING;
TM2/A10 = &DT.QUOTEDSTRING;
END
TABLE FILE CAR
PRINT TM
TM2
BY COUNTRY
END
As per above sample, with the configuration that I have, TM is displayed as 2019-08-01 and since it's a text field TM2 is displayed as 08/01/2019
This is an invalid command : -SET &DT = IF &DT NE _FOC_NULL THEN &DT ELSE CLAIMS.FROM_DT; You cannot set a variable to a file field value but you can set a variable to a file field for display such as below
-DEFAULTH &DT = 08/01/2019
-*-DEFAULTH &DT = _FOC_NULL
-SET &FLD = IF &DT NE _FOC_NULL THEN CAR ELSE _FOC_NULL;
DEFINE FILE CAR
TM/MDYY = &DT.QUOTEDSTRING;
TM2/A10 = &DT.QUOTEDSTRING;
END
TABLE FILE CAR
PRINT TM
TM2
BY COUNTRY
BY &FLD
END
Why is this "I really want to see what the format is coming from the HTML" so important ?
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
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
This is an invalid command : -SET &DT = IF &DT NE _FOC_NULL THEN &DT ELSE CLAIMS.FROM_DT;
Not completely invalid - It works because of loose syntax rule or maybe by design?
If you really want to apply strict syntax, it could be made "syntax pure"(?!?!) by adding quotes around the assignment of the field. Add that to my suggestion above and this should do the trick -
-SET &DT = IF &DT NE _FOC_NULL THEN '''' || &DT || '''' ELSE 'CLAIMS.FROM_DT';
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004