Focal Point
[SOLVED] Assign parameter value to a varible to be included in report output?

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

April 08, 2009, 02:24 PM
Jeff_Rowland
[SOLVED] Assign parameter value to a varible to be included in report output?
Is there a way that you can assign parameter(s) values to variables so the parameter values can be include in the output of a report.

Example:

TABLE FILE CENTORD
PRINT
'CENTORD.OINFO.ORDER_NUM'
'CENTORD.STOSEG.STORENAME'
'CENTORD.OINFO.DATE_ORDERED'
'CENTORD.INVSEG.PRICE'
WHERE ( CENTORD.OINFO.DATE_ORDERED GE '&SD.START.' ) AND ( CENTORD.OINFO.DATE_ORDERED LE '&ED.END.' );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
ENDSTYLE
END



Entering 10/19/2001 for &SD and &ED results in the following output

Order Number: Store Name: DATE_ORDERED Price:
48219 Web Sales 10/19/2001 899.00
48219 Web Sales 10/19/2001 109.00
48219 Web Sales 10/19/2001 89.00
48219 Web Sales 10/19/2001 499.00
48219 Web Sales 10/19/2001 299.00

What I would like to do is to include the report parameters values in the output so the output would look like the following:

Order Number: Store Name: DATE_ORDERED Price: Param1 Param2
48219 Web Sales 10/19/2001 899.00 10/19/2001 10/19/2001
48219 Web Sales 10/19/2001 109.00 10/19/2001 10/19/2001
48219 Web Sales 10/19/2001 89.00 10/19/2001 10/19/2001
48219 Web Sales 10/19/2001 499.00 10/19/2001 10/19/2001
48219 Web Sales 10/19/2001 299.00 10/19/2001 10/19/2001

This message has been edited. Last edited by: Kerry,


7.7.02 Windows7
HTML/Excel/PDF
April 08, 2009, 02:56 PM
Francis Mariani
TABLE FILE CENTORD
PRINT
'CENTORD.OINFO.ORDER_NUM'
'CENTORD.STOSEG.STORENAME'
'CENTORD.OINFO.DATE_ORDERED'
'CENTORD.INVSEG.PRICE'
COMPUTE SD/A10 = '&SD'; AS 'Param1'
COMPUTE ED/A10 = '&ED'; AS 'Param2'
WHERE ( CENTORD.OINFO.DATE_ORDERED GE '&SD.START.' ) AND ( CENTORD.OINFO.DATE_ORDERED LE '&ED.END.' );



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
April 08, 2009, 03:03 PM
Rao D
How about assigning the parameter to a define field and call that Define field in your table request.


Rao.


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

April 08, 2009, 03:05 PM
Rao D
Francis has better solution performance wise.

Rao.


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

April 09, 2009, 07:41 AM
Jeff_Rowland
Thanks Francis! It worked just as you stated. I had spent hours going through on-line documentation, scouring over messages in the WebFocus forums and had even tried using the Compute to assign the parameter values to a variable but kept getting errors. Looking at your solution the main problem was I was not using the ' ' around the &SD and &ED field names.

I was strictly using the menu options in WebFocus to create a Compute variable but when I clicked on the &SD and &ED fields to assign to variables, the ' ' are not automatically placed around the variable as per your suggestion.

Thanks again for your assistance.

P.S. Are you aware if the use of the ' ' around the variables is documented in any of the WebFocus manuals. I've searched but didn't come up with any hits.

Jeff


7.7.02 Windows7
HTML/Excel/PDF
April 09, 2009, 08:32 AM
Tony A
Jeff,

If you think of it logically then the value you had for your variable would be interpretted as a calculation if not surrounded by single quotes. This result (numeric) would then be rejected as incompatable data type for an alpha field.

If you had specified a MDYY field then you may have had success.

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