Focal Point
[CLOSED] Passing Parameter Values in Report Caster

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

November 30, 2011, 02:27 PM
Rick Man
[CLOSED] Passing Parameter Values in Report Caster
I have a report that is in production that prompts for a term code and a date. I now want to put it into Report Caster and have it default to the current term code and system date.

How can I pass those into the report without having to modify the report?

I can create 2 procedures that would get the 2 parameters and put them in amper variables. I tried running them as PRE-PROCESS procedures but that doesn't seem to work.

The best that I've been able to come up with is to put a -INCLUDE in the report and that works. However I lose the prompting capabilty. I suspect I could figure that out with -SET or -DEFAULT if I thought about it long enough.

But this isn't a one time shot. We often will have a report in production and then decide to put it into Report Caster. So it would be nice if there was a way to pass the variable into the report from Report Caster without having to modify the report fex.

Here are my 2 -INCLUDE FEXs.
There are obviously many ways to skin this part of the cat. I could just as easily have used native WebFOCUS code vs. SQL passthru, but that isn't the challenge.

ENGINE SQLORA SET DEFAULT_CONNECTION GOLD
SQL SQLORA PREPARE SQLOUT FOR
SELECT MIN(STVTERM_CODE)
FROM STVTERM
WHERE STVTERM_END_DATE >= SYSDATE;
END
-*
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS A1
END
-RUN
-*
-READ A1, &TERM
-RUN
-TYPE &TERM
  


  
ENGINE SQLORA SET DEFAULT_CONNECTION GOLD
SQL SQLORA PREPARE SQLOUT FOR
SELECT TO_CHAR((TRUNC(SYSDATE)),'YYYYMMDD') FROM DUAL;
END
-*
SET HOLDLIST=PRINTONLY
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS A1
END
-RUN
-*
-READ A1, &PAYDATE.A8.
-RUN
-TYPE &PAYDATE

This message has been edited. Last edited by: Rick Man,


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
November 30, 2011, 02:54 PM
RSquared
We use Dialogue Manager to do this. I am including our code but suggest you modify to suit your needs.

 
-DEFAULT &BEG_DATE_IN = '' ;
-DEFAULT &END_DATE_IN = '' ;
-PROMPT &BEG_DATE_IN.Enter the beginning date (mm/dd/yyyy).
-PROMPT &END_DATE_IN.Enter the ending date (mm/dd/yyyy).
-IF &BEG_DATE_IN EQ '' OR &END_DATE_IN EQ '' THEN GOTO SETDEFAULTZ ;

-*************************************************************************************
-* Use the reporting dates as per user inputs.
-* need to convert the input dates to yyyy/mm/dd format for the SQL
-TYPE *** DATES ENTERED .. &BEG_DATE_IN &END_DATE_IN ***
-SET &BEG_DATE_HDG = &BEG_DATE_IN ;
-SET &END_DATE_HDG = &END_DATE_IN ;
-SET &BEG_DATE = EDIT(&BEG_DATE_IN,'$$$$$$9999') || '/' || EDIT(&BEG_DATE_IN,'99999') ;
-SET &END_DATE = EDIT(&END_DATE_IN,'$$$$$$9999') || '/' || EDIT(&END_DATE_IN,'99999') ;
-GOTO RUNTHEREPORT

*************************************************************************************
-* Get the dates of the previous quarter
-SETDEFAULTZ
-INCLUDE GETQUART
-SET &BEG_DATE = &PREVQBEGY ;
-SET &END_DATE = &PREVQENDY ;
-SET &BEG_DATE_HDG = &PREVQBEGM ;
-SET &END_DATE_HDG = &PREVQENDM ;

-*************************************************************************************
-* We have the dates, either by user input or automatic calculations with procedure.
-RUNTHEREPORT ;




WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
November 30, 2011, 03:15 PM
Rick Man
Thanks.
That gets me the variables within the fex, or -INCLUDE. I'm hoping there is a slick way to pass them from Report Caster.

I've also done a check like
-IF &FOCFOCEXEC = 'RCASTER' THEN 'do something' ELSE 'do something else'


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
November 30, 2011, 03:30 PM
RSquared
Rick,

We put this code into most of our Focexecs. Alternatively, you can put the values into the RC job in the Advanced Task Options ares.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
November 30, 2011, 04:18 PM
Rick Man
quote:
Alternatively, you can put the values into the RC job in the Advanced Task Options ares

What do you mean? Hard code them? Like 201108 and 20111130. It might take an amper variable.
I just tried putitng the amper variable in the parameters tab and that didn't work.


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
November 30, 2011, 04:54 PM
RSquared
Exactly, you would have to change them every time you run. The other way works very well and the process can be used for any variable that can either be entered or be defaulted to,


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
December 01, 2011, 03:53 AM
Wep5622
Another option is to -INCLUDE your fex in a wrapper-fex that calculates the input values for you. Your RC job then calls the wrapper-fex.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
December 01, 2011, 04:40 PM
Rick Man
Yea, that's what I'll do.
Thanks all


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF