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.
I am stuck on a situation to display custom error message in compound report in EXL2K (having 2 or more than 2 sheets). To display custom error message, I include a .fex file to program based on a below condition:
-IF &LINES EQ 0 THEN GOTO ERRORMSG; -ERRORMSG -INCLUDE ERROR_MESSAGE.FEX
-GOTO END_RPT
I don't want to used to hold data and print error message based on the no of records in hold file(should satisfied above condition). I want to print data directly from database like below:
TABLE FILE CAR SUM AMOUNT RATE BY MODEL WHERE COUNTRY EQ 'INDIA'; ON TABLE PCHOLD FORMAT EXL2K OPEN END
Problem situation: Suppose there is situation when there is data only for 'INDIA' not for 'U.K.', then 2nd PCHOLD will close and report will not print any record. After that processor reads condition for error message, which comes true. But report will not include this error message sheet because compound report got closed in 2nd PCHOLD.
Please suggest me here any best approach to deal with this problem situation.
Thanks, Sandeep SagarThis message has been edited. Last edited by: <Kathryn Henning>,
Is there any specific reason, you should not hold the data?
&LINES wont be assigned until the TABLE FILE request ends either as a HOLD or a PCHOLD...
One simple solution is something as below. Have a dummy sheet at the end printing nothing...
TABLE FILE CAR
SUM
SALES
BY MODEL
WHERE COUNTRY EQ 'JAPAN';
ON TABLE PCHOLD FORMAT EXL2K OPEN
END
-IF &LINES EQ 0 THEN ERRORMSG1 ELSE SKIP_ERRORMSG1;
-ERRORMSG1
-INCLUDE error_message.fex
-SKIP_ERRORMSG1
TABLE FILE CAR
SUM
SALES
BY MODEL
WHERE COUNTRY EQ 'INDIA';
ON TABLE PCHOLD FORMAT EXL2K
END
-IF &LINES EQ 0 THEN ERRORMSG2 ELSE SKIP_ERRORMSG2;
-ERRORMSG2
-INCLUDE error_message.fex
-SKIP_ERRORMSG2
TABLE FILE CAR
PRINT
CAR NOPRINT
ON TABLE PCHOLD FORMAT EXL2K CLOSE
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='x',$
END
Thanks,
Ramkumar. WebFOCUS/Tableau Webfocus 8 / 7.7.02 Unix, Windows HTML/PDF/EXCEL/AHTML/XML/HTML5
Posts: 394 | Location: Chennai | Registered: December 02, 2009
I already go ahead with this approach but my WF Manager does not want solution like this way. He suggests me to passes data as minimum as possible. That's the reason to not use HOLD file. In this approach, we call TABLE 3 times, but I want solution in 2 calls only.
Thanks for your suggestions. By using SET EMPTYREPORT = ON, I get the report with having column name and heading information. But here is different scenario for me. I have another .fex file for displaying error message on the report when there is not data found in Database. This error message may be one of given below: 1. WebFocus Error Code 2. No data found in Database
Also, report output needs to display heading information, image/logo and footer information(Footer information can be achieved by using SET EMPTYREPORT = ANSI).
My main motive is "To include my custom error message .fex file by using only two passes of data (If there only sheets in the report)."
We have had the same requirement and there is no real solution outside of validating if data is returned and if not, including a no data fex. The only way to do that is to use a hold file.
- FOCUS Man, just FOCUS! ----------------------------- Product: WebFOCUS Version: 8.1.04 Server: Windows 2008 Server
Here's an approach that might work. My embedded error logic would be replaced with your -INCLUDE ERRORMSG.FEX. You can uncomment one or both of the WHERE clauses to see how report failures are handled.
-* Set EMPTYREPORT off so empty sheets are not created.
SET HOLDLIST = PRINTONLY
SET ASNAMES = ON
SET EMPTYREPORT = OFF
-*
-* Run the first report request, which opens the spreadsheet file.
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
-* WHERE COUNTRY EQ 'INDIA';
ON TABLE PCHOLD FORMAT EXL07 OPEN
END
-*
-RUN
-* If the first report request produces output, go to the second report request.
-IF (&LINES GT 0) GOTO :RPT_2 ;
-*
-* If the first report request fails, display an error message.
TABLE FILE CAR
HEADING
"Your first report did not produce any output."
PRINT COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1 ;
ON TABLE PCHOLD FORMAT EXL07
END
-RUN
-*
-:RPT_2
-*
-* Run the second report request.
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
-* WHERE COUNTRY EQ 'SPAIN';
ON TABLE PCHOLD FORMAT EXL07
END
-*
-RUN
-* If the second report request produces output, go to a final dummy request to close the spreadsheet.
-IF (&LINES GT 0) GOTO :CLOSE_RPT ;
-*
-* If the second report request fails, display an error message.
TABLE FILE CAR
HEADING
"Your second report did not produce any output."
PRINT COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1 ;
ON TABLE PCHOLD FORMAT EXL07
END
-RUN
-*
-:CLOSE_RPT
-* The only purpose of this final dummy report request is to close the spreadsheet file.
TABLE FILE CAR
PRINT COUNTRY
WHERE COUNTRY EQ 'NONSENSE';
WHERE RECORDLIMIT EQ 1 ;
ON TABLE PCHOLD FORMAT EXL07 CLOSE
END
-RUN
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
One thing that I would remind you about when using an -INCLUDE multiple times within the same procedure and that is that you should ensure that you do not use GOTO [Label] syntax as you could inadvertently cause a loop.
So, what is the most important thing to achieve here? Is it to produce a report with the minimal amount of data handling or is it to produce the error message(s)?
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004