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 been working on showing images in a PDF report as data row. I have to append a value and image and show that in a column. I can do that in HTML,but how do i achieve that in PDF.
Here is the sample code i use to show images in a PDF.I need to append any column along with the column N1. Not sure where i will append. In HTML format i can append that in a define field and use.
-*WHENCE img1 PNG
-*-RUN
-*-EXIT
DEFINE FILE WF_RETAIL
ICON_PATH/A500V=
IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Accessories' THEN 'IBFS:/WFC/Repository/Apps/Images/green_icon.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Camcorder' THEN 'IBFS:/WFC/Repository/Apps/Images/green_icon.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Computers' THEN 'IBFS:/WFC/Repository/Apps/Images/green_icon.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Media Player' THEN 'IBFS:/WFC/Repository/Apps/Images/green_icon.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Stereo Systems' THEN 'IBFS:/WFC/Repository/Apps/Images/green_icon.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Televisions' THEN 'IBFS:/WFC/Repository/Apps/Images/green_icon.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Video Production' THEN 'IBFS:/WFC/Repository/Apps/Images/green_icon.png' ELSE '';
ICON/A500V='<IMG SRC="'||ICON_PATH||'" width=28px height=28px>';
END
TABLE FILE WF_RETAIL
SUM
WF_RETAIL.WF_RETAIL_SALES.REVENUE_US
BY WF_RETAIL.WF_RETAIL_PRODUCT.ICON_PATH
BY WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY
BY LOWEST WF_RETAIL.WF_RETAIL_SALES.SALE_UNITY
WHERE RECORDLIMIT EQ 1000
WHERE READLIMIT EQ 1000
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
TYPE=DATA,
COLUMN=N1,
IMAGE=(ICON_PATH),
SIZE=(.3 .3),
$
ENDSTYLE
END
Any one attempted this scenario.?This message has been edited. Last edited by: FP Mod Chuck,
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
Posts: 229 | Location: MI | Registered: September 13, 2017
It looks like you should be able to do that using conditional styling, where you define one image and condition for each PRODUCT_CATEGORY.
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
TYPE=DATA, COLUMN=N1,$ Default case
TYPE=DATA, COLUMN=N1, IMAGE=('IBFS:/WFC/Repository/Apps/Images/green_icon.png'), SIZE=(.3 .3),
WHEN=PRODUCT_CATEGORY EQ 'Accessories',$
TYPE=DATA, COLUMN=N1, IMAGE=('IBFS:/WFC/Repository/Apps/Images/green_icon.png'), SIZE=(.3 .3),
WHEN=PRODUCT_CATEGORY EQ 'Camcorder',$
TYPE=DATA, COLUMN=N1, IMAGE=('IBFS:/WFC/Repository/Apps/Images/green_icon.png'), SIZE=(.3 .3),
WHEN=PRODUCT_CATEGORY EQ 'Computers',$
etc.
ENDSTYLE
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
You should be able to achieve both HTML and PDF outputs using the following (I've used images on my install so they may/may not be on yours) -
DEFINE FILE WF_RETAIL
ICON_PATH/A100V = IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Accessories' THEN 'C:\ibi\AppStudio82\webapps\webfocus\activereports\distribution\images\irbcomment.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Camcorder' THEN 'C:\ibi\AppStudio82\webapps\webfocus\activereports\distribution\images\irbfltg.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Computers' THEN 'C:\ibi\AppStudio82\webapps\webfocus\activereports\distribution\images\irblock.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Media Player' THEN 'C:\ibi\AppStudio82\webapps\webfocus\activereports\distribution\images\irbhrglss.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Stereo Systems' THEN 'C:\ibi\AppStudio82\webapps\webfocus\activereports\distribution\images\irbunlock.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Televisions' THEN 'C:\ibi\AppStudio82\webapps\webfocus\activereports\distribution\images\irbline.png'
ELSE IF WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ 'Video Production' THEN 'C:\ibi\AppStudio82\webapps\webfocus\activereports\distribution\images\irbscattr.png' ELSE '';
END
TABLE FILE WF_RETAIL
SUM
WF_RETAIL.WF_RETAIL_SALES.REVENUE_US
BY ICON_PATH
BY WF_RETAIL.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY
BY WF_RETAIL.WF_RETAIL_SALES.SALE_UNITY
WHERE RECORDLIMIT EQ 1000
WHERE READLIMIT EQ 1000
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET BYDISPLAY ON
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
TYPE=DATA,
COLUMN=N1,
IMAGE=(ICON_PATH),
SIZE=(0.291667 0.291667),
$
ENDSTYLE
END
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
@Tony & @Wep5622, Thanks for the examples. I am able to get the images in PDF.The code i posted also does that. But what i am trying to do is, append REVENUE_US along with the ICON. I am able to append that in HTML using define.But in PDF output format i am not able to do that. Sorry for not being clear earlier.
WF8206,Windows 7,8,10 HTM,PDF,EXCEL
Posts: 229 | Location: MI | Registered: September 13, 2017
Even in HTML the image is a seperate object and not merged (as you seem to imply) except from the viewpoint that they could be contained within the same tabular cell (<TD> element).
A PDF stream doesn't really have the same construct as HTML output so, no, you can't do that.
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