Focal Point
[SOLVED] Inserting images in PDF report

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/741105142

September 16, 2009, 06:18 PM
Prash1983
[SOLVED] Inserting images in PDF report
I have a column in my file which contains the "name of the image file" which I want to insert in my PDF report. I do have the base URL too.
I want the corresponding image to be displayed in the report based on the column value.
Eg-
my file has data as follows:

Fld name 1 Field name 2
A11111 attachment name 1
A11112 attachment name 2

Base URL is "\\XXXXXX\XX"

My report should look like as follows:
A11111 Image displayed for attachment name1


A11112 Image displayed for attachment name2


Can anybody help?

This message has been edited. Last edited by: Kerry,


webFOCUS 7.6.x,
z/OS(Mainframes),
Excel and HTML
September 17, 2009, 05:22 AM
GamP
Images in PDF can only be displayed as part of the heading if you wish to include it in the report request. The other possibility is to include them through a compound report. But I don't think you will want it that way.
You can have more than one image inserted in the heading, and you can position and size it. But it has to be in the heading of the report.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 17, 2009, 10:18 AM
Francis Mariani
I searched FocalPoint for "PDF IMAGE DATA" and one of the results was Image in row of a PDF report, a very clever technique by Darin Lee, PDF guru. So you CAN insert images in a data row of a PDF report! (I've tried it and it works beautifully).


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 17, 2009, 06:57 PM
Prash1983
Francis,
I think I am real close but not getting the image displayed on the report.
Attaching the chunk of code I am using for this purpose:

-DEFAULT &FORMAT = 'PDF'
-DEFAULT &DISTRIBUTION = 'EMAIL'
-SET &BASEURL = '\\XXXXXX\XXXX\'


DEFINE FILE ABCD
IMAGE1 /A300 =
IF ATTACHMENT_LINK LIKE '%.JPG'
OR '%.jpg'
OR '%.PNG'
OR '%.png'
OR '%.GIF'
OR '%.gif'
THEN '&BASEURL' | ATTACHMENT_LINK
ELSE '' ;
END

TABLE FILE ABCD
PRINT
FLD1 AS 'FLD1'
ATTACHMENT_NAME AS 'ATTACHMENT NAME'
IMAGE1 AS 'ATTACHMENT'

BY BURST_VALUE NOPRINT
BY SOME OTHER FIELD NOPRINT
BY FLD1 NOPRINT
BY ATTACHMENT_LINK NOPRINT
ON ATTACHMENT_LINK SUBFOOT
" "
" "
WHEN ATTACHMENT_LINK LIKE '%.JPG' OR '%.jpg' OR '%.PNG' OR '%.png' OR
'%.GIF' OR '%.gif';
ON TABLE FOOTING
" "
" "
ON TABLE SET HTMLCSS ON
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
TYPE=REPORT,
TITLETEXT='MY REPORT',
SQUEEZE=ON,
WRAP=OFF,
FONT=ARIAL,
SIZE=10,
$
TYPE=TITLE,SIZE=10,FONT=ARIAL,
JUSTIFY=CENTER,
COLOR=NAVY,BACKCOLOR=NONE,STYLE=BOLD+UNDERLINE,
$
TYPE=DATA,COLUMN=N7,IMAGE=(IMAGE1),SIZE=(5.0 2.5),$
ENDSTYLE

ON TABLE PCHOLD FORMAT &FORMAT

END
-RUN

Please let me know if I am making any mistake in the code.


webFOCUS 7.6.x,
z/OS(Mainframes),
Excel and HTML
September 17, 2009, 07:15 PM
Francis Mariani
The image MUST be in an App folder that is in the APPPATH.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 17, 2009, 07:20 PM
Prash1983
I don't know anything about App folder or APPPATH. My requirement is to fetch the image from a network folder. Can I do so?


webFOCUS 7.6.x,
z/OS(Mainframes),
Excel and HTML
September 18, 2009, 12:49 PM
Prash1983
Hi Francis,
Please let me a bit more about App folder and APPPATH.
Thanks!


webFOCUS 7.6.x,
z/OS(Mainframes),
Excel and HTML
September 18, 2009, 03:48 PM
Francis Mariani
How about searching IBI Documentation?

Creating Reports With WebFOCUS Language > Laying Out the Report Page > Adding an Image to a Report

Displaying the Current Search Path

Developing Reporting Applications > Creating and Working With Applications > Managing Applications and Paths in the Data Management Console


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 21, 2009, 01:43 PM
Darin Lee
BASEURL is irrelevant when creating a PDF document. As Francis states, all the images that are used must be in your server path. You can get more info about that from the links he kindly posted.

Additionally, going from your profile which states you are using WF on z/OS, all references to locations must be made in context of the WF server. So a location of "\\XXXXXX\XXXX\" would be meaningless to a z/OS server. You're probably going to have to move your images to a location that can be referenced by your WF server to get what you want.


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
September 22, 2009, 02:43 PM
Prash1983
Thanks Francis and Darin!!
I am looking into the links to find the solution.
But, I would like to state here that the code works for Excel report and the images gets inserted into the report!!


webFOCUS 7.6.x,
z/OS(Mainframes),
Excel and HTML
September 22, 2009, 04:51 PM
Darin Lee
Right. It will work for Excel and HTML output, but it will not work for PDF output. PDF output has its own rules.


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