Focal Point
[SOLVED] Getting current report name

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

July 07, 2009, 10:01 AM
Tim Bayer
[SOLVED] Getting current report name
Does anyone know of an easy way for me to grab the current report name minus the .fex, so I can populate a variable with it?

For example; for report "MyReport.fex", I want to be able to grab "MyReport"

Thanks!

This message has been edited. Last edited by: Tim Bayer,



------------------------------------
WebFOCUS Version 7.6.2
July 07, 2009, 10:08 AM
Stefaans
Hi
You may find this useful. You would have to place this in the code.
TABLE FILE MCTADJX
"&FOCFOCEXEC "
SUM KOUNT1
WHERE RECORDLIMIT IS 10
END


WebFOCUS 7.7.01 Windows, TSO 7.0
July 07, 2009, 10:29 AM
Stefaans
Hi
I am an old mainframer.Smiler
Try this for WebFOCUS. It works,just tested it
regards Steve
DEFINE FILE SQLOUT
NNAME/A16 ='&FOCFOCEXEC';
LEN/I6 = ARGLEN(16,NNAME,'I6');
NEWLEN/I6 = LEN-4; -* dont want .fex
NUMCHAR/I6 = (NEWLEN -2) +1;
NEWNAME/A16 = SUBSTR(16,NNAME,2,NEWLEN,NUMCHAR,'A16');
END
TABLE FILE SQLOUT
PRINT
fund_id asset_id CALEN_DT NEWNAME
HEADING doubleqquote NEWNAME with a less than sign goes in here doublequote

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


WebFOCUS 7.7.01 Windows, TSO 7.0
July 07, 2009, 10:52 AM
Francis Mariani
Tim,

If you're working with WF 7.6 and later, there's a newish variable &FOCFEXNAME that gives you the name of the fex without '.fex'. &FOCFOCEXEC has been providing an incorrect name since at least v5.3 days - it has an underscore at the front of the name.

Fex name: temporary123.fex
&FOCFEXNAME = temporary123
&FOCFOCEXEC = _temporary123

Try adding -? & to the top of your fex to list all the available variables at execution time.

This does not apply if you're running the fex via MRE - different variables are created.

(Please update your profile with the version of WebFOCUS you're working with.)


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
July 07, 2009, 11:57 AM
Tim Bayer
Francis, I tried your idea first because I was hoping it was as easy as a system defined variable. When I put the -? & at the top of my fex I get three variables back that contain the report name:

&FOCFEXNAME = MyReport.fex
&FOCFOCEXEC = _MyReport.fex
&FEX_NAME = MyReport.fex

The &FOCFEXNAME seems to also return .fex. I have not tried the other ideas yet, I will look at them now.

Thanks for the ideas.



------------------------------------
WebFOCUS Version 7.6.2
July 07, 2009, 12:20 PM
Tom Flynn
  
-SET &ECHO=ALL;
-SET &FOC_FEXNAME = 'MyReport.fex';
-SET &FEX_OUT= GETTOK(&FOC_FEXNAME.EVAL, &FOC_FEXNAME.LENGTH, 1, '.', 20, 'A20');
-TYPE &FEX_OUT
-EXIT



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 07, 2009, 12:36 PM
Francis Mariani
Or

-SET &ECHO=ALL;
-SET &FOC_FEXNAME = 'MyReport.fex';

-SET &FEX_OUT= TRIM('T', '&FOC_FEXNAME.EVAL', &FOC_FEXNAME.LENGTH, '.fex', 4, 'A&FOC_FEXNAME.LENGTH');

-TYPE &FEX_OUT



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
July 07, 2009, 12:41 PM
Tim Bayer
Tom and Francis, both of those methods worked.

Thanks!



------------------------------------
WebFOCUS Version 7.6.2