Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Setting a Defined Value as a Default Parameter

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Setting a Defined Value as a Default Parameter
 Login/Join
 
Member
posted
Hi All

In my report I need to default the parameter to the first of the following month.

To achieve this, I used DEFINE to calculate Beginning of Next Month. Now I want this field to prompt as default to the user.

As of now, the report prompts the user to enter NextInvoiceDate; but I want this date to default to 1st of the following month (04/01/2017).

I did search the Forum, and found a similar query, however that didn't work for me. Link for that is - http://forums.informationbuild...377048086#5377048086

-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


My code is as follows:

[ DEFINE FILE VW_RECURR_CHARGES_VIEW
NextInvoiceDate/HMDYY=VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NEXT_INVOICE_DATE;
TODAY/MDYY='&DATEMDYY';
BEG_CUR_MONTH/MDYY=DATEMOV(TODAY, 'BOM');
END_CUR_MONTH/MDYY=DATEMOV(TODAY, 'EOM');
BEG_NXT_MONTH/MDYY=DATEADD(BEG_CUR_MONTH, 'M', 1);
END

-DEFAULT &NextInvoiceDate = &BEG_NXT_MONTH.EVAL;


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:'

ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.TERMINAL_ID SUBHEAD
"ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.TERMINAL_ID SUBTOTAL AS 'Total for Terminal:'
ON TABLE SUBHEAD
"NR - 21 Recurring Charges Report"
" Next Invoice Date: &NextInvoiceDate"
" Page: " Report Run Date: <+0>&DATEMDYY <+0> "
WHERE VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate LE '&NextInvoiceDate';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE SET BYDISPLAY OFF
ON TABLE SET DROPBLNKLINE ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT.(,,).Select type of display output:.
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENBlue_Medium2.sty,
$
TYPE=REPORT,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
$
TYPE=DATA,
COLOR='BLACK',
BACKCOLOR=( 'WHITE' RGB(235 235 240) ),
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N5,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N6,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N7,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
DRILLMENUITEM='Customer Trend',
FOCEXEC=IBFS:/WFC/Repository/MAA/N/NR_-_21_-_11-02-2016/Customer_Trend_12-22-2016.fex( \
BRASS_CUSTOMER_ID=N7 \
),
TARGET='_blank',
$
TYPE=DATA,
COLUMN=N8,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N9,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
DRILLMENUITEM='Lease Details',
FOCEXEC=IBFS:/WFC/Repository/MAA/N/NR_-_21_-_11-02-2016/NR-21_Recurring_Charges_Report.fex( \
LEASE_AGRMNT_ID=N9 \
),
TARGET='_blank',
$
TYPE=DATA,
COLUMN=N10,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N5,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N6,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N7,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N8,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N9,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N10,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
JUSTIFY=CENTER,
$
TYPE=TABHEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
SIZE=16,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=2,
OBJECT=TEXT,
ITEM=1,
SIZE=16,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
JUSTIFY=RIGHT,
$
TYPE=TABHEADING,
LINE=3,
OBJECT=TEXT,
ITEM=1,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=TEXT,
ITEM=2,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=TEXT,
ITEM=3,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=FIELD,
ITEM=1,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=FIELD,
ITEM=2,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=FIELD,
ITEM=3,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=4,
JUSTIFY=RIGHT,
$
TYPE=TABHEADING,
LINE=4,
OBJECT=TEXT,
ITEM=1,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=4,
OBJECT=TEXT,
ITEM=2,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=4,
OBJECT=TEXT,
ITEM=3,
COLOR='BLACK',
$
TYPE=HEADING,
SIZE=14,
JUSTIFY=RIGHT,
$
TYPE=SUBHEAD,
BY=1,
BACKCOLOR=RGB(51 102 255),
$
TYPE=SUBHEAD,
BY=2,
BACKCOLOR=RGB(51 102 255),
$
TYPE=REPORT,
COLUMN=N5,
SQUEEZE=1.055556,
$
TYPE=REPORT,
COLUMN=N6,
SQUEEZE=0.680556,
$
TYPE=REPORT,
COLUMN=N7,
SQUEEZE=1.166667,
$
TYPE=REPORT,
COLUMN=N8,
WRAP=1.180556,
$
TYPE=REPORT,
COLUMN=N9,
SQUEEZE=1.180556,
$
TYPE=REPORT,
COLUMN=N10,
SQUEEZE=1.180556,
$
ENDSTYLE
END /]

Thank You

This message has been edited. Last edited by: FP Mod Chuck,


Webfocus 8.1.05
 
Posts: 9 | Registered: November 14, 2013Report This Post
Expert
posted Hide Post
DEFINE FILE VW_RECURR_CHARGES_VIEW
NextInvoiceDate/HMDYY=VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NEXT_INVOICE_DATE;
TODAY/MDYY='&DATEMDYY';
BEG_CUR_MONTH/MDYY=DATEMOV(TODAY, 'BOM');
END_CUR_MONTH/MDYY=DATEMOV(TODAY, 'EOM');
BEG_NXT_MONTH/MDYY=DATEADD(BEG_CUR_MONTH, 'M', 1);
END

-DEFAULT &NextInvoiceDate = &BEG_NXT_MONTH.EVAL;

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.

-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');

-TYPE &DT_NM
-TYPE &DT_BONM

-DEFAULT &NextInvoiceDate = &DT_BONM.EVAL;


Read up on these Date functions: DATEADD, DATEMOV and DATECVT...

(SOLVED) Date Conversion

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thank You Francis for helping me understand what I was doing wrong.

I used the SET command as suggested, however when the report is run, the NextInvoiceDate box displays '&DT_BONM.EVAL' and not the date.

Thank You


Webfocus 8.1.05
 
Posts: 9 | Registered: November 14, 2013Report This Post
Virtuoso
posted Hide Post
quote:
the NextInvoiceDate box displays '&DT_BONM.EVAL'

Which box ?

If it's in
" Next Invoice Date: &NextInvoiceDate"

Try
" Next Invoice Date: &NextInvoiceDate.EVAL"


Can you post your whole new code please ? It may help to understand if the above doesn't solved the issue.

Also pay attention that you have some double quotes that should be there and can cause error or non expected result
quote:
"Next Invoice Date: ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate RECOMPUTE AS 'Total for Next Invoice Date:'

quote:
"ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.TERMINAL_ID SUBTOTAL AS 'Total for Terminal:'


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, 2013Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Thank You Francis.

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.

My Code is as follows:

-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$$$$');

-TYPE &DT_NM
-TYPE &DT_BONM
-TYPE &FRMTDATE

-DEFAULT &NextInvoiceDate = &FRMTDATE.EVAL;

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:'

ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.TERMINAL_ID SUBHEAD
"ON VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.TERMINAL_ID SUBTOTAL AS 'Total for Terminal:'
ON TABLE SUBHEAD
"NR - 21 Recurring Charges Report"
" Next Invoice Date: &FRMTDATE.EVAL"
" Page: " Report Run Date: <+0>&DATEMDYY <+0> "
WHERE VW_RECURR_CHARGES_VIEW.VW_RECURR_CHARGES_VIEW.NextInvoiceDate LE '&FRMTDATE.EVAL';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE SET BYDISPLAY OFF
ON TABLE SET DROPBLNKLINE ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT.(,,).Select type of display output:.
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENBlue_Medium2.sty,
$
TYPE=REPORT,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
$
TYPE=DATA,
COLOR='BLACK',
BACKCOLOR=( 'WHITE' RGB(235 235 240) ),
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N1,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N2,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N3,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
DRILLMENUITEM='Customer Trend',
FOCEXEC=IBFS:/WFC/Repository/MAA/N/NR_-_21_-_11-02-2016/Customer_Trend_12-22-2016.fex( \
BRASS_CUSTOMER_ID=N3 \
),
TARGET='_blank',
$
TYPE=DATA,
COLUMN=N4,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=DATA,
COLUMN=N5,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
DRILLMENUITEM='Lease Details',
FOCEXEC=IBFS:/WFC/Repository/MAA/N/NR_-_21_-_11-02-2016/NR-21_Recurring_Charges_Report.fex( \
LEASE_AGRMNT_ID=N5 \
),
TARGET='_blank',
$
TYPE=DATA,
COLUMN=N6,
FONT='TREBUCHET MS',
SIZE=9,
BACKCOLOR='NONE',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N1,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N2,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N3,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N4,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N5,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TITLE,
COLUMN=N6,
FONT='TREBUCHET MS',
SIZE=9,
COLOR='BLACK',
STYLE=BOLD,
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
JUSTIFY=CENTER,
$
TYPE=TABHEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
SIZE=16,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=2,
OBJECT=TEXT,
ITEM=1,
SIZE=16,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
JUSTIFY=RIGHT,
$
TYPE=TABHEADING,
LINE=3,
OBJECT=TEXT,
ITEM=1,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=TEXT,
ITEM=2,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=TEXT,
ITEM=3,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=FIELD,
ITEM=1,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=FIELD,
ITEM=2,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=3,
OBJECT=FIELD,
ITEM=3,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=4,
JUSTIFY=RIGHT,
$
TYPE=TABHEADING,
LINE=4,
OBJECT=TEXT,
ITEM=1,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=4,
OBJECT=TEXT,
ITEM=2,
COLOR='BLACK',
$
TYPE=TABHEADING,
LINE=4,
OBJECT=TEXT,
ITEM=3,
COLOR='BLACK',
$
TYPE=HEADING,
SIZE=14,
JUSTIFY=RIGHT,
$
TYPE=SUBHEAD,
BY=1,
BACKCOLOR=RGB(51 102 255),
$
TYPE=SUBHEAD,
BY=2,
BACKCOLOR=RGB(51 102 255),
$
TYPE=REPORT,
COLUMN=N1,
SQUEEZE=1.055556,
$
TYPE=REPORT,
COLUMN=N2,
SQUEEZE=0.680556,
$
TYPE=REPORT,
COLUMN=N3,
SQUEEZE=1.166667,
$
TYPE=REPORT,
COLUMN=N4,
WRAP=1.180556,
$
TYPE=REPORT,
COLUMN=N5,
SQUEEZE=1.180556,
$
TYPE=REPORT,
COLUMN=N6,
SQUEEZE=1.180556,
$
ENDSTYLE
END


Webfocus 8.1.05
 
Posts: 9 | Registered: November 14, 2013Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by Nams:
Thank You Francis.

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).

Have you ever used Document Composer?


WebFOCUS 8.105M, Windows 10, App Studio
 
Posts: 47 | Registered: October 22, 2014Report This Post
Virtuoso
posted Hide Post
Nams

Here is a simple example where a WHERE statement can force a populated autoprompt

TABLE FILE CAR
SUM RETAIL_COST DEALER_COST
BY COUNTRY
WHERE  COUNTRY EQ '&COUNTRY.(FIND COUNTRY IN CAR).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, 2005Report This Post
Virtuoso
posted Hide Post
Nams

A second example using a foccache hold file.

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, 2005Report This Post
Virtuoso
posted Hide Post
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, 2013Report This Post
Gold member
posted Hide Post
If want to stick with the auto prompter you could make a separate fex that you -INCLUDE into your report that has the default value.

In the separate fex (will call it NextInvoiceDate.fex as an example) would just have something like this.
-DEFAULT &NextInvoiceDate=20170401;


Then in your report you can do
-INCLUDE NextInvoiceDate.fex

DEFINE FILE VW_RECURR_CHARGES_VIEW
...


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


WF: 8201, OS: Windows, Output: HTML, PDF, Excel
 
Posts: 78 | Registered: November 08, 2010Report This Post
Virtuoso
posted Hide Post
Martin

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, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Setting a Defined Value as a Default Parameter

Copyright © 1996-2020 Information Builders