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.
In the following code, I need the second line in the heading to be displayed only if the SALES is more than 0. Otherwise that line should not be displayed.
TABLE FILE CAR PRINT CAR DEALER_COST RETAIL_COST BY COUNTRY NOPRINT ON COUNTRY PAGE-BREAK HEADING "Car Details" "Car Sales <SALES" END
Please let me know.This message has been edited. Last edited by: Cyril Joy,
Regards, Cyril Joy.
WF Production 8008 on Linux.
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004
DEFINE FILE CAR
SOME_WORDS/A60 = 'Car Sales ' | SALES;
OTHER_WORDS/A60 = ' ';
HEAD_LINE2/A60 = IF SALES GT 0 THEN SOME_WORDS ELSE OTHER_WORDS;
END
Or get the sales number into an amper var.
HEADING
" "
"<HEAD_LINE2"
This message has been edited. Last edited by: jimster06,
jimster06 DevStu WF 7.6.11 W7 HTML, PDF, EXL2K
Posts: 252 | Location: USA | Registered: April 15, 2003
While JIMSTER's idea should work, it could cause overhead in processing due to having the extra define fields.
There is a way to put a WHEN condition on a SUBHEAD. I don't think this works with HEADING and I no longer have somewhere where I can test it before I sent this off to you.
If you replace the HEADING with the following:
ON COUNTRY SUB-HEAD
"Car Details"
"Car Sales <SALES"
WHEN SALES NE 0;
ON COUNTRY SUB-HEAD
"Car Details"
WHEN SALES EQ 0;
This message has been edited. Last edited by: cmallain,
------------------------------------------ last version used: v7.1; truly miss the wonderful things I did with WebFOCUS, HTML, & JavaScript.
Posts: 36 | Location: Rolling Meadows, IL | Registered: September 05, 2007
Or you can branch over the second heading line with dialogue manager if sales is equal to zero.
TABLE FILE CAR PRINT CAR DEALER_COST RETAIL_COST BY COUNTRY NOPRINT ON COUNTRY PAGE-BREAK HEADING "Car Details" -IF SALES EQ 0 GOTO SKIPHDR2; "Car Sales -SKIPHDR2 END
WF 7.7.05 HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files HTML, Excel, PDF
A couple of things here for informational purposes:
cmallain: SUB-HEAD should be SUBHEAD but still will not work with the original PRINT because SALES will be the first and only the first SALES line for that country unless that is what you want.
linus: '-IF SALES' is mixing DM and TF so WebFOCUS ignores this step. WF does not know what SALES is when processing the DM lines. I'm actually surprised there is no error. I would expect one but didn't get it.
IHTH. Greg
Greg
current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11
TABLE FILE CAR
SUM SALES BY COUNTRY
PRINT CAR DEALER_COST RETAIL_COST
BY COUNTRY
ON TABLE HOLD FORMAT ALPHA
END
TABLE FILE HOLD
PRINT CAR DEALER_COST RETAIL_COST
BY COUNTRY NOPRINT
ON COUNTRY PAGE-BREAK
HEADING
"Car Details for <COUNTRY"
ON COUNTRY SUBHEAD
"Car Sales <SALES"
WHEN SALES NE 0;
END
For HTML output only, the following (using Ginny's hold file) gets around the HEADING/TITLE/SUBHEAD changing order depending on sales:
DEFINE FILE HOLD
SALESA/A8=FTOA(SALES,'(D6)',SALESA);
HDR2/A100V=IF SALES NE 0 THEN 'Car Details for ' | COUNTRY | '<BR>Car Sales ' | SALESA ELSE 'Car Details for ' | COUNTRY;
END
TABLE FILE HOLD
PRINT CAR DEALER_COST RETAIL_COST
BY COUNTRY NOPRINT
ON COUNTRY PAGE-BREAK
HEADING
"<HDR2"
ON TABLE PCHOLD FORMAT HTML
END
Greg
current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11
SUBHEAD will not work in my Code as it is a part of the heading and there are more lines after and before it as follows:
TABLE FILE CAR
PRINT CAR DEALER_COST RETAIL_COST
BY COUNTRY NOPRINT
ON COUNTRY PAGE-BREAK
HEADING
"Car Details"
"Car Sales <SALES"
"More heading here"
END
Any other way to acheive this?
Regards, Cyril Joy.
WF Production 8008 on Linux.
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004
DEFINE FILE HOLD
SALESA/A8=FTOA(SALES,'(D6)',SALESA);
HDR1/A100V=IF SALES NE 0 THEN 'Car Sales ' | SALESA ELSE 'More headings1';
HDR2/A100V=IF SALES NE 0 THEN 'More headings1' ELSE 'More headings2';
HDR3/A100V=IF SALES NE 0 THEN 'More headings2' ELSE 'More headings3';
HDR4/A100V=IF SALES NE 0 THEN 'More headings3' ELSE 'More headings4';
HDR5/A100V=IF SALES NE 0 THEN 'More headings4' ELSE '';
END
TABLE FILE HOLD
PRINT CAR DEALER_COST RETAIL_COST
BY COUNTRY NOPRINT
ON COUNTRY PAGE-BREAK
HEADING
"Car Details"
"<HDR1"
"<HDR2"
"<HDR3"
"<HDR4"
"<HDR5"
ON TABLE PCHOLD FORMAT PDF
END
Greg
current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11
TABLE FILE CAR
SUM SALES NOPRINT COMPUTE
MYSAL/D12.2 = C1; NOPRINT COMPUTE
MYLINE/A24 = IF MYSAL EQ 0 THEN ' ' ELSE
'Car Sales ' | FTOA(MYSAL,'(D10)','A13') ; NOPRINT
BY COUNTRY NOPRINT
PRINT CAR DEALER_COST RETAIL_COST SALES
BY COUNTRY NOPRINT
ON COUNTRY PAGE-BREAK
HEADING
"Car Details: <COUNTRY "
"<MYLINE "
" "
END
This message has been edited. Last edited by: Edward Wolfgram,