Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Image in PDF Report appended with another column/value.
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Image in PDF Report appended with another column/value.
 Login/Join
 
Platinum Member
posted
Hi,

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,


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 190 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 :
 
Posts: 1630 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
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.05 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.05 standalone on Windows 10 
 
Posts: 5524 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
@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.


WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 190 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
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.05 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.05 standalone on Windows 10 
 
Posts: 5524 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi Tony,

Thanks for clarifying.
In HTML i append image to the value as shown below.
The define field Def_IMAGECONCAT will have image and value as a column.

  
BASE_PATH/A500V ='WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/Apps/Images/';
ICON_PATH/A500V = IF Def_ROW EQ 'Percent Change' AND SaleCount GT 0 THEN BASE_PATH || 'green_icon.png' ELSE IF Def_ROW EQ 'Percent Change' AND SaleCount LT 0 THEN BASE_PATH || 'red-icon.png';
ICON/A500 = '<IMG SRC="'||ICON_PATH||'" width=10px height=10px>';
Def_IMAGECONCAT/A600V = IF Def_ROW EQ 'Percent Change' AND SaleCount GT 0 THEN ICON|' '|FPRINT(SaleCount,'D12.2','A100') ELSE IF Def_ROW EQ 'Percent Change' AND SaleCount GT 0 THEN ICON|' '|FPRINT(SaleCount,'D12.2','A100') ELSE FPRINT(SaleCount,'D20','A100');



WF8202M,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 190 | Location: MI | Registered: September 13, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
append image to the value

They are still two seperate objects!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.05 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.05 standalone on Windows 10 
 
Posts: 5524 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Image in PDF Report appended with another column/value.

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.