Focal Point
Report Caster Parameters

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3341033851

March 10, 2006, 10:45 AM
Bethany
Report Caster Parameters
I'm trying to set up my report to pass a date parameter of the SYSTEM_DATE -1


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
March 10, 2006, 11:36 AM
susannah
Bethany, lookup the AYMD function
it adds or subtracts days from &var dates, like
-SET &YESTERDAY = AYMD ( &YYMD , -1, 'I8YYMD');
-SET &TOMORROW = AYMD ( &YYMD , 1 , 'I8YYMD');
So, you could have a variable &ADJ as a parm
-DEFAULT &ADJ = 0 ;
-SET &YESTERDAY = AYMD ( &YYMD , &ADJ * (-1), 'I8YYMD');
So if you wanted to run for last week, then your &ADJ = 7 in your caster parms.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 10, 2006, 12:42 PM
jodye
Hi Bethany

I believe that we do exactly what you are trying to do with this post and your other post. Putting together the answers from Susannah and Francis...

This code will set &MYDATE to yesterday if there is no value for MYDATE passed as a param to the fex. Just make sure that when the report is run from caster, the MYDATE param is empty or not present, that way the default date used is yesterday.

-SET &ECHO=ALL;
-DEFAULTS &MYDATE='';
-SET &YESTERDAY=AYMD(&YYMD,-1,'I8');
-SET &MYDATE = IF &MYDATE EQ '' THEN &YESTERDAY ELSE &MYDATE;
-TYPE MYDATE = &MYDATE

When the report is not run from caster, a value is always passed for MYDATE, so that gets used instead of the default of yesterday.

Jodye


WF 8.0.0.5M
March 10, 2006, 12:47 PM
Francis Mariani
That makes sense. Cleaner.


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
March 16, 2006, 05:27 PM
Bethany
Thanks for the suggestion. Anyone know if this could work with a smart date? When the user inputs the date it's sent from the launch page as a YYMD.


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
March 16, 2006, 11:42 PM
susannah
Bethany, you can convert an I8YYMD to a smart date and vice-versa, even if they're in dialog manager form. In the 'Using Functions' manual, there's a whole chapter on dates. very enlightening. you'll get a lot of ideas from it.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID