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 have a requirement to conditionally display an asterisk on a numeric dollar field on a report (HTML and PDF). One idea I had was to concatenate the asterisk to the numeric field, but I believe I will lose the WebFOCUS formatting by doing this. I would have to add the formatting ($ sign and commas) myself.
Does anyone have any cool techniques where I could do this without losing my WebFOCUS numeric formatting?
Thanks!This message has been edited. Last edited by: JRLewis,
If it replacing the field you can try the following:
SET NODATA = '*'
DEFINE FILE CAR
XDEALER_COST/D7 MISSING ON = IF DEALER_COST GT 10000 THEN MISSING ELSE DEALER_COST;
END
TABLE FILE CAR
PRINT XDEALER_COST DEALER_COST
BY CAR
END
-RUN
WF 8.2.01M 8.2.01M Reporting Server Windows 2012 Srvr R2 PDF,Excel, HTML Graphs - a lot of graphs
Posts: 60 | Location: Atlanta, GA | Registered: October 30, 2003
The field I want to print is a sales calculation. In some exception cases, I want to display an '*' next to the sales number. For example, the column on the report would look like this: $47,000* (except probably would want to have the asterisk as a superscript). Another thing we have to do is have a total line for sales.
The first thing I tried was to have a separate column on the report for the asterisk, but because the report puts spacing between the sales column and the asterisk, it is not acceptable.
The next thing I was considering was to have the asterisk as part of the sales field, but I think that will cause issues with the totaling. I am going to play around with that, but I am not confident.
I suppose the asterix is because of you want those figures get special attention. There are lot other ways to do this How about colors, bold, underlines etc This all can be done and it does not influence the calculation results.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
Frank, I am in total agreement with you. The requirement given to me was to display the asterisk, so I am going down that path to see if it is possible and what the implications are.
I think we will go back and revisit the requirement to see if we can change some minds!
If you definitely need the asterisk right there along your number you'll have no other easy choice but to define an entirely different field (ALPHA) with the formatted value as you want it to be displayed. As for the TOTAL, you can implement it by using SUBFOOT.
Here's an example using the CAR table:
DEFINE FILE CAR
TOT_SALES/D20 = SALES;
END
TABLE FILE CAR
SUM
TOT_SALES NOPRINT
COMPUTE NEW_SALES/A30 = IF COUNTRY EQ 'ENGLAND' OR 'JAPAN' THEN FTOA(SALES, '(D20.2)', 'A29') || '*' ELSE FTOA(SALES, '(D20.2)', 'A30');
BY COUNTRY
BY CAR
ON TABLE SUBFOOT
"TOTAL<+0> <+0><TOT.TOT_SALES"
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=NEW_SALES, JUSTIFY=RIGHT, $
TYPE=TABFOOTING, HEADALIGN=BODY, STYLE=BOLD, $
TYPE=TABFOOTING, OBJECT=FIELD, ITEM=1, JUSTIFY=RIGHT, $
END
This message has been edited. Last edited by: njsden,
Thanks for the example - it looks good! I am still going to my customer to see if we cannot use another method, but if they are insistent, this looks like a good method.
-SET &OUTPUT = 'HTML';
-SET &FLAG = IF &OUTPUT EQ 'PDF' THEN '*' ELSE '*&|nbsp;&|nbsp;&|nbsp;&|nbsp;';
-*
DEFINE FILE CAR
FLAG/A30 = IF DEALER_COST GT 10000 THEN '&FLAG' ELSE ' ';
END
-*
TABLE FILE CAR
PRINT DEALER_COST/D9.2M AS 'Dealer Cost'
FLAG AS ''
RETAIL_COST/D9.2M AS 'Retail Cost'
BY COUNTRY AS 'Country'
BY CAR AS 'Car'
ON TABLE SET BYDISPLAY ON
ON TABLE SET HTMLCSS OFF
ON TABLE PCHOLD FORMAT &OUTPUT
ON TABLE SET STYLE *
GRID=OFF, SQUEEZE=ON, $
TYPE=REPORT, COLUMN=FLAG, POSITION=+0.0, $
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
How about this - it removes the spaces between fields (IN +0):
DEFINE FILE CAR
ASTERISK/A1 = IF DEALER_COST GT 1000 THEN '*' ELSE ' ';
END
TABLE FILE CAR
PRINT DEALER_COST/D9.2M
ASTERISK AS '' IN +0
BY CAR
ON TABLE PCHOLD FORMAT PDF
END
-RUN
WF 8.2.01M 8.2.01M Reporting Server Windows 2012 Srvr R2 PDF,Excel, HTML Graphs - a lot of graphs
Posts: 60 | Location: Atlanta, GA | Registered: October 30, 2003
I would also suggest going with the solution rpovided by mrguru. We do this in many reports and it seems to be the easiest approach. You don't have to tinker with the actual fields/formats. Just add a new field to display the asterisk when it is required and scoot it up next to the dollar value field. aslo easier to stylize in case you needed to add a drill-down to the asterisk or something like that.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
My first attempt was mrguru's solution. While I did not present it to my customer, the issue I had with it is that it did not appear to be related to the field, due to html spacing. Even when I put in the 'IN +0', the asterisk looked like it was in its own column on the report.
We presented the issues to the customer, and they agreed to use italics instead of the asterisk, so we have resolved this by using a different method.
Thanks for all your ideas and suggestions - I always learn new things!