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     [SOLVED] Setting up Global Functions

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Setting up Global Functions
 Login/Join
 
Member
posted
Is it possible to set up functions to do the following:

I would like to be able to insert the following code below into every WebFOCUS report we create so that when the footer for our reports needs to change, we only have to change it in one place.

-SET &CUR_DATE = &DATEMDYY;
-SET &CUR_TIME = EDIT(HHMMSS('A8'),'99:$99:$99');
-SET &HOUR=EDIT(&CUR_TIME, '99$$$$$$');
-SET &HOUR2=EDIT(&HOUR);
-SET &HOUR3=IF &HOUR2 GT 12 THEN &HOUR - 12 ELSE &HOUR;
-SET &HOUR4=IF &HOUR2 GT 12 AND &HOUR2 LT 22 THEN '0' || &HOUR3 ELSE &HOUR3;
-SET &HOUR5=IF &HOUR3 GT 9 THEN EDIT(&HOUR4, '99') ELSE EDIT(&HOUR4, '$9');
-SET &AM_PM = IF &HOUR2 GE 12 THEN 'PM' ELSE 'AM';
-SET &CUR_TIME2=&HOUR5 || EDIT(&CUR_TIME,'$$999$$$') || ' ' | &AM_PM || ' CDT';
-SET &CUR_DTTM = &CUR_DATE | ' ' | &CUR_TIME2;

We use the following code to create a footer for our reports (the &CUR_DTTM is used towards the bottom of the code below):

SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='0.5^0.5^0.5^0.5', MERGE=OFF, ORIENTATION=LANDSCAPE, PAGESIZE=Letter, $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=.75, TOPMARGIN=.25,METADATA='BOTTOMMARGIN=.75,TOPMARGIN=.1,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(1.25 0.15), DIMENSION=(* *), REQUIRED-SPACE=(* 3), METADATA='Z-INDEX: 100; LEFT: 0.15in; OVERFLOW: auto; WIDTH: 10.85in; POSITION: absolute; TOP: 0.063in; HEIGHT: 1.458in; REQUIRED-SPACE-HEIGHT: 3', $
OBJECT=STRING, NAME='text99', TEXT='As of Date: &DATA_STATUS', POSITION=(.5 7.88), MARKUP=OFF, WRAP=ON, DIMENSION=(3.437 0.146), font='ARIAL', color=navy, size=8, METADATA='FONT-SIZE: 8pt; Z-INDEX: 101; LEFT: 0.52in; WIDTH: 3.437in; COLOR: #000099; FONT-FAMILY: Arial; POSITION: absolute; TOP: 8.094in; HEIGHT: 0.146in', $
OBJECT=STRING, NAME='text51', TEXT='For Internal Use Only', POSITION=(5.1 8.0), MARKUP=OFF, WRAP=ON, DIMENSION=(1.354 0.146), font='ARIAL', color=navy, size=8, METADATA='FONT-SIZE: 8pt; Z-INDEX: 103; LEFT: 5.063in; WIDTH: 1.354in; COLOR: #000099; FONT-FAMILY: Arial; POSITION: absolute; TOP: 8.229in; HEIGHT: 0.146in', $
OBJECT=STRING, NAME='text50', TEXT='&Cpyr 2009, Company Name', POSITION=(4.75 7.88), MARKUP=OFF, WRAP=ON, DIMENSION=(2.604 0.146), font='ARIAL', color=navy, size=8, METADATA='FONT-SIZE: 8pt; Z-INDEX: 104; LEFT: 4.396in; WIDTH: 2.604in; COLOR: #000099; FONT-FAMILY: Arial; POSITION: absolute; TOP: 8.083in; HEIGHT: 0.146in', $
OBJECT=STRING, NAME='text1', TEXT='Page of ', POSITION=(9.5 7.88), MARKUP=ON, WRAP=ON, DIMENSION=(1.1 0.167), font='ARIAL', color=RGB(0 0 153), size=8, METADATA='FONT-SIZE: 8pt; Z-INDEX: 105; LEFT: 9.477in; WIDTH: 1.1in; COLOR: #000099; FONT-FAMILY: Arial; POSITION: absolute; TOP: 8.083in; HEIGHT: 0.167in', $
OBJECT=STRING, NAME='text2', TEXT='Run Date: &CUR_DTTM', POSITION=(.5 8.0), MARKUP=OFF, WRAP=ON, DIMENSION=(3.438 0.156), font='ARIAL', color=navy, size=8, METADATA='FONT-SIZE: 8pt; Z-INDEX: 100; LEFT: 0.52in; WIDTH: 3.438in; COLOR: #000099; FONT-FAMILY: Arial; POSITION: absolute; TOP: 8.24in; HEIGHT: 0.156in', $
END
SET COMPONENT='report1'
-INCLUDE pir_rpt
COMPOUND END

Or is there a better way to do this? We need to be able to change the format of Run Date in one place and have it change on all of our reports. The same goes for the Copyright year. I'm open to suggestions! This code will usually run through ReportCaster once the report is created.

Thanks.

This message has been edited. Last edited by: Kerry,
 
Posts: 5 | Registered: October 12, 2006Report This Post
Virtuoso
posted Hide Post
If you put the series of -SET commands to generate standard footing values in a fex file (either on server or within MR), and -INCLUDE that at the top of each report fex, the &vars will be available for reference in the footing.

Is that all you need?


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
It would be better to make a separate file rather than function..and you can include this file wherever you want.....
that's definitely an easy option....for the maintenance purpose........

regards,
anmol


WebFocus7.6.2, WebFocus 7.1.1,Windows
HTML, PDF and Excel
 
Posts: 71 | Registered: June 30, 2009Report This Post
Silver Member
posted Hide Post
You can have all the SET veraibles with default values and the entire logic in a separate INCLUDE file. Then you can just Assgin values to Variables when needed and call the INCLUDE file wherever necessary.


Webfocus 8002M, 8009
OS: Windows7
 
Posts: 33 | Registered: July 31, 2008Report This Post
Member
posted Hide Post
Thanks to all of you for your help. Sometimes it is hard to see the forest for the trees!
 
Posts: 5 | Registered: October 12, 2006Report 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     [SOLVED] Setting up Global Functions

Copyright © 1996-2020 Information Builders