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] Calling a .fex from maintain error

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Calling a .fex from maintain error
 Login/Join
 
Gold member
posted
Hi everyone,

I am trying to call a webfocus report from maintain. The report works fine when I run it by itself, but when I call it from maintain I receive the following error,
FOC03690 Called Proc, EmergencyFunding, wants 0 output parms but was called w/ 1.
I am passing one parameter to the .fex, and I want to display the output in an HTML object on a form.
The call I am using in Maintain is
 EXEC EmergencyFunding FROM ReportVar INTO ReportStack; 

Any ideas on why I receive this error would be greatly appreciated.

Thanks,
Bryan

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


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Virtuoso
posted Hide Post
Bryan

Using:
EXEC EmergencyFunding FROM ReportVar INTO ReportStack;

The focexec EmergencyFunding should contain a parameter &1, which is equivalent to ReportVar that you are passing on the EXEC line. You cannot refer to &ReportVar in the focexec, they are only read in sequence from the EXEC call as &1, &2 etc.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Gold member
posted Hide Post
Thanks for your reply Alan
I understand that the focexec must contain &1.
The code in the focexec looks like this,
 WHERE SEMCODE EQ '&1'; 

I have passed parameters from maintain procedures to focexecs before with no problem. That is why this error is so confusing to me.

Bryan


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Virtuoso
posted Hide Post
Sorry Bryan
Misread the error message you gave.

Can you post the focexec EmergencyFunding. Have come across this before, but cannot think of the cause straight off.

Ensure you are doing an ON TABLE PCHOLD in there, that could be a cause. Also make sure the focexec will run in native mode from WF.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Also, is the ReportStack an HTML stack or a column based stack?

From the original post it is an HTML stack so you should have ON TABLE PCHOLD FORMAT HTMTABLE as the output in the focexec.

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Gold member
posted Hide Post
You may have pinpointed the problem Alan, but this just raises more questions. The code for the focexec is:
 -* File EmergencyFunding.fex
DEFINE FILE EMERGENCY_FUNDS
NAME/A60=EF_LNAME || ( ', ' | EF_FNAME);
END
TABLE FILE EMERGENCY_FUNDS
PRINT
     HFCCID
     NAME
     DATE
     TYPE
     AMOUNT
HEADING
"&1"
FOOTING
"Total Spent: <TOT.AMOUNT"
WHERE SEMCODE EQ '&1';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
$
TYPE=TITLE,
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=HEADING,
     SIZE=12,
     STYLE=BOLD,
$
TYPE=FOOTING,
     SIZE=12,
     STYLE=BOLD,
	 JUSTIFY=RIGHT,
$
TYPE=SUBHEAD,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     SIZE=10,
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
     SIZE=9,
$
TYPE=ACROSSTITLE,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     BACKCOLOR=RGB(210 210 210),
     STYLE=BOLD,
$
ENDSTYLE
END
 

As you can see I was using the line
 ON TABLE PCHOLD FORMAT HTMTABLE 

I thought that using that line and passing it to a stack with a field named HTML/A250 would allow me to display the output in a HTML object on a form.

Bryan


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Virtuoso
posted Hide Post
Bryan

I cannot remember now the exact syntax and the expected output, I would have to start another server to get to the maintain code, and its late here. Initially your code looks fine.

Something is niggling about this error, and I will test over the weekend.

Thanks for your patience.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
Bryan

This message is the one produced when the focexec fails to produce an output.

To debug this run through focMsg:
Repeat FocMsg.FocCount; Counter/I3=1;
   Type "<FocMsg(Counter).Msg";
Endrepear Counter=Counter+1;

after the EXEC. You may have to view source to see the whole output as a left carat can stop the display, or other elements get in the way.

This can happen, for example, if ReportVar has a single quote in it. If that is the case you can use &1.QUOTEDSTRING in the focexec WHERE to help.

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Hi Bryan
When using : ON TABLE PCHOLD FORMAT HTMLTABLE or ON TABLE PCHOLD FORMAT HTML you need to have:
COMPUTE HTMLSTK.HTML/A2000;
EXEC procedure FROM var INTO HTMLSTK
Of course your stack name can be whatever you want it to be.

And then display the stack in an HTML Object. However the error that you are getting implies that no records are being returned. The best way to debug an EXEC statement is, at the beginning of the FEX, add:

-SET &ECHO=ALL;

When the procedure runs, the entire FEX is echoed back to the screen. Then, on your Maintain form, place an HTMLTable populated from FOCMSG.MSG. This is a system stack that returns all messages typed to the screen, back to the Maintain. You will see any errors or problems encountered at runtime.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
Mark

Since when has an A2000 been required. All documentation (and experience) uses A250.

Also ON TABLE PCHOLD FORMAT HTML causes the maintain screen to end short if used in an HTML object as it contains the HTML end tag.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Alan
All I know is what works for me. The only doc'd reference that I could find for it was part of the FanClubs tutorial. You are correct though. I usually use an A200. So I usually have:

Compute HTMLSTK.HTML/A200;
EXEC procedure INTO HTMLSTK

In the procedure I use:
ON TABLE PCHOLD FORMAT HTML

and I can display HTMLSTK.HTML an HTMLObject on my form. I tried this morning and got an error with:
ON TABLE PCHOLD FORMAT HTMLTABLE.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
Mark

Weird isn't it. I ALWAYS use HTMTABLE. I think that some browsers, maybe it's safari on mac, really wobbles with maintain and an html object populated with HTML output.

But as they say, if it works for you.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Gold member
posted Hide Post
I really appreciate both of your help.
quote:
This message is the one produced when the focexec fails to produce an output.

You were correct about this Alan. This was due to me sending the parameters to the .fex in upper case rather than lower.
I am still confused about the difference between
 ON TABLE PCHOLD FORMAT HTML 
and
 ON TABLE PCHOLD FORMAT HTMLTABLE 
The documentation states that to preserve the report formatting to use
 ON TABLE PCHOLD FORMAT HTMLTABLE 
This seems to be the complete opposite for me, because when I use that the report is displayed with default formatting. On the other hand when I use
 ON TABLE PCHOLD FORMAT HTML 
all the custom formatting is preserved. I'm not sure why this is happening, but my report works and that is what really concerns me.

Thanks for all your help,
Bryan

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


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Gold member
posted Hide Post
One more thing, is there a way I can handle this error, with an if statement perhaps, that would allow me to print a more helpful message to the user if they execute a report that has no output records?

Bryan


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Virtuoso
posted Hide Post
As you may see, Mark and I use a different approach, Mark uses HTML and I use HTMTABLE.

When you use HTMTABLE, make sure you do not use:
ON TABLE SET HTMLCSS ON

otherwise you will loose all styling.

I use ON TABLE SET HTMLCSS OFF, and it works fine with HTMTABLE. I've had issues with the closing HTML tag when using HTML output.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
To issue a message to a user, you could just place some message into the htmlStack in the focexec.
-IF &LINES GT 0 GOTO :BYPASS;
TABLE FILE CAR
SUM
COMPUTE MSG/A50 = 'No Records retrieved';
BY HIGHEST 1 COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT HTMTABLE
END
-EXIT
-:BYPASS


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
If no records are returned from the Table request, then you can test:
IF HTMLSTK.FOCCOUNT = 0 THEN...
Or whatever the name of your stack is. Just make sure you do a:
STACK CLEAR HTMLSTK
Before you do your exec.

You can also try issuing before the EXEC:
SYS_MGR.FOCSET("WARNING", "OFF");

That should turn off the error being returned the the screen.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
I have tried using these lines prior to issuing the EXEC
 SYS_MGR.FOCSET("WARNING", "OFF"); 
and
 SYS_MGR.FOCSET("MESSAGE", "OFF"); 
and
 SYS_MGR.FOCSET("EMGSRV", "OFF"); 
and even
 SYS_MGR.FOCSET("MAINTAIN_WARNING", "OFF"); 

none of these turn off this error message.
I am able to print my own more descriptive message to the user, but the warning still appears. The worst part about it is the fact that it locks the application when the message appears, and you have to close the entire app and relaunch it.
Any ideas on what I may be missing?

Bryan

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


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Master
posted Hide Post
Bryan
Programming has informed me that this project is on the "To Do" list. I'm afraid the SYS_MSG commmands cannot shut off that messsage.

Having said that, your application should not freeze. You can branch depending on the foccount of the stack receiving the data. What is happening on your form?

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
Mark
Upon further review the form does not completely lock, but the scroll bar disappears. Since none of the buttons on my form were visible when the scroll bar was all the way up it seemed as the though the application was locked. I found the buttons were still functional when I moved them higher up on the form so they would be visible when the form was first loaded. So while the app is not technically frozen when this message appears, if there are no buttons immediately visible when the form loads the only option the user has is to close the browser. I have found a workaround for this problem by adding this line to the fex
 SET EMPTYREPORT = ON 
This prevents this error message from being displayed since the fex is always returning some form of output, but it would certainly be nice to be able to turn the message off completely.

Bryan


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
 
Posts: 54 | Registered: January 16, 2008Report This Post
Master
posted Hide Post
Bryan
That is an elegant solution. I will see that this feature gets on the list of things to do.

Thanks
Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report 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] Calling a .fex from maintain error

Copyright © 1996-2020 Information Builders