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.
-SET &COUNTRY_ALREADY='ENGLAND'; -DEFAULT &COUNTRY=&COUNTRY_ALREADY.EVAL; TABLE FILE IBISAMP/CAR BY CAR.ORIGIN.COUNTRY BY CAR.COMP.CAR BY CAR.CARREC.MODEL WHERE CAR.ORIGIN.COUNTRY EQ '&COUNTRY'; 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:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,$ ENDSTYLE END -RUN
TABLE FILE VW_RECURR_CHARGES_VIEW SUM VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.AMOUNT/D20.2!D AS 'Amount' BY TODAY BY BEG_CUR_MONTH BY END_CUR_MONTH BY BEG_NXT_MONTH BY LOWEST VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate AS 'Next Invoice Date' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.TERMINAL_ID AS 'Terminal ID' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.BRASS_CUSTOMER_ID AS 'BRASS Customer ID' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.CUSTOMER_NAME AS 'Customer Name' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.LEASE_AGRMNT_ID AS 'Lease Agreement ID'
ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate SUBHEAD "Next Invoice Date: ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate RECOMPUTE AS 'Total for Next Invoice Date:'
You're mixing WebFOCUS code and Dialogue Manager (scripting) code here - BEG_NXT_MONTH is a column in a report, while &BEG_NXT_MONTH is a variable. You could create a HOLD file and then -READ or -READFILE to retrieve the value into a parameter, but there is a Dialogue Manager solution:
To move the current date to the first day of the next month, you can use Date functions, though it will take two functions to do it - one to add a month to the current date, another to move the result to the beginning of the month. This has been discussed many times on the forum.
The inner DATECVT converts a string to a date. Then the DATEADD/DATEMOVE function is applied. Then the outer DATECVT converts the resulting date back to a string.
This message has been edited. Last edited by: Francis Mariani,
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
As you've read, unfortunately, there does not seem to be a way to have the autoprompt window recognize the parameter value set in the -DEFAULT command.
We never use autoprompt - we create parameter pages with controls to populate the variable values.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
I'm reading more on DEFAULT command, and how I can use it in my code.
When I'm running the report, while selecting the Parameters, the default box for NextInvoiceDate displays (the words) '&FRMTDATE.EVAL' , whereas I was expecting it to populate the date calculated as &FRMTDATE.
DEFINE FILE VW_RECURR_CHARGES_VIEW NextInvoiceDate/HMDYY=VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NEXT_INVOICE_DATE; END TABLE FILE VW_RECURR_CHARGES_VIEW SUM VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.AMOUNT/D20.2!D AS 'Amount' BY LOWEST VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate AS 'Next Invoice Date' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.TERMINAL_ID AS 'Terminal ID' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.BRASS_CUSTOMER_ID AS 'BRASS Customer ID' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.CUSTOMER_NAME AS 'Customer Name' BY VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.LEASE_AGRMNT_ID AS 'Lease Agreement ID'
ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate SUBHEAD "Next Invoice Date: ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate RECOMPUTE AS 'Total for Next Invoice Date:'
I'm reading more on DEFAULT command, and how I can use it in my code.
When I'm running the report, while selecting the Parameters, the default box for NextInvoiceDate displays (the words) '&FRMTDATE.EVAL' , whereas I was expecting it to populate the date calculated as &FRMTDATE.
Nams,
I wasn't aware that the default parameter could be populated from table logic within the report. The only way I was ever able to pre-populate a parameter was by building the "Parameter Screen" in document composer. If you aren't familiar with Document Composer, then it is going to be more of a challenge.
However, if you know how to use it, each parameter can be tied to its own separate report which runs when you open it and then feeds into the primary report. I've never quite done it with a date, per say, but I have done it to have a drop down list that only shows the latest five years (for example).
TABLE FILE CAR
SUM COUNTRY
BY COUNTRY
ON TABLE HOLD AS FOCCACHE/TEMPHLD FORMAT ALPHA
END
-RUN
FILEDEF TEMPHLD DISK foccache/temphld.ftm
-RUN
TABLE FILE CAR
SUM RC DC SEATS
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY.(FIND COUNTRY IN FOCCACHE/TEMPHLD).COUNTRY.'
END
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005
An issue with that Chuck is the following. Try with this:
TABLE FILE CAR
SUM COUNTRY
BY COUNTRY
WHERE COUNTRY NE 'FRANCE';
ON TABLE HOLD AS FOCCACHE/TEMPHLD FORMAT ALPHA
END
-RUN
FILEDEF TEMPHLD DISK foccache/temphld.ftm
-RUN
TABLE FILE CAR
SUM SEATS
BY COUNTRY
WHERE COUNTRY EQ '&CNTRY.(FIND COUNTRY IN FOCCACHE/TEMPHLD).COUNTRY.'
END
-RUN
You will then have
ENGLAND
ITALY
JAPAN
W GERMANY
as available Country choices. Then change the filter from FRANCE to ITALY and rerun.
From the above we assume that now ITALY should have disappear from the choices and FRANCE get there. But it's not the case unless you wait for browser cache to be expired, manually clear browser cache or open a new browser.
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
The down side is do have to specify the value and would need to remember to change it once a month so is more of a manual way.
There is a way to automate it more by rewriting what is within NextInvoiceDate.fex but would need to setup a schedule to run a third fex that will write to NextInvoiceDate.fex. I did do a post on how I do that earlier if you want to go that route to give an idea. Although for what you'd be wanting would be for only one and the examples in there are for multiple fexes. [SHARING] Semi-Dynamic Prompt Includes with Defaults
The below would be more or less what you'd want to update NextInvoiceDate.fex.
-SET &FILE_DEF='E:\ibi\apps\baseapp\';
-SET &FEX_NAME='NextInvoiceDate';
-SET &DT_NM = DATECVT( DATEADD( DATECVT(&YYMD,'I8YYMD','YYMD') ,'M', 1), 'YYMD','I8YYMD');
-SET &DT_BONM = DATECVT( DATEMOV( DATECVT(&DT_NM,'I8YYMD','YYMD') ,'BOM'),'YYMD','I8YYMD');
-SET &FRMTDATE = EDIT (&DT_BONM, '$$$$99$$') || '/' || EDIT(&&NMONTH, '$$$$$$99') || '/' || EDIT(&&NMONTH, '9999$$$$');
-*Commented out so if try to run this won't accidently be making files in random places. Uncomment once know where you want them, have write access to .fex, and have updated the value in &FILE_DEF.
-*FILEDEF INCL_UPDATE DISK &FILE_DEF..&FEX_NAME...FEX
-*-RUN
-*-WRITE INCL_UPDATE -DEFAULT &|NextInvoiceDate='&FRMTDATE.EVAL';
-*-CLOSE INCL_UPDATE
-*-RUN
You are right clearing foccache seems to be tough to do. I tried the following code at the bottom but it took running the procedure twice to get FRANCE to show up again..
-DEFAULTH &APPLOC='';
-SET &FOC_HOLD_NAME='temphld';
TABLE FILE SYSAPPS
PRINT APPLOC
WHERE APPNAME EQ 'foccache';
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS H_FOCPATH FORMAT ALPHA
END
-RUN
-IF &LINES EQ 0 THEN GOTO L_ERROR;
-READFILE H_FOCPATH
-RUN
-SET &APPLOC=TRUNCATE(&APPLOC);
-TYPE &APPLOC
-SET &FOCCACHE_FILE = &APPLOC | '\' | &FOC_HOLD_NAME | '.ftm';
-SET &FOCCACHE_MAS = &APPLOC | '\' | &FOC_HOLD_NAME | '.mas';
-RUN
-DOS DEL &FOCCACHE_MAS
-DOS DEL &FOCCACHE_FILE
-RUN
-L_ERROR
-*
-RUN
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005