Focal Point
[SOLVED] How to add an image to a row on a PDF report

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

March 31, 2009, 08:38 AM
JDroke
[SOLVED] How to add an image to a row on a PDF report
We have a folder on our image server with 200,000+ jpg images of our parts. Is there a way to write a report that would also show an image of the part on the report (row)? We have the image name in the table that produces the report so there is no problem there. The problem seems to be (1) how to position the image by row and (2) how to reference the image server for the image instead of having the images in the app path. I have waded through many search topics on this but as of yet have not found what I'm looking for. Anyone doing this?

Update: with more searching, I found the answer to number 1 - thanks Darin Lee. Number 2 is my problem.

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


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
March 31, 2009, 08:58 AM
GamP
As far as I know, the only way to get an image in a pdf document is by including it in a heading.
And the image has to reside on a physical path where the reporting server can reach it.

What you could try to do is create a very sophisticated pdf compound report that has numerous table requests with one line per request as a result and each with its own image.

If you decide to go and try that alley, I hope you're successful...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 31, 2009, 09:11 AM
mgrackin
JDroke,

1) What technigue are you using to put the images in rows on a PDF docuemnt?

2) The images must be in the APPPATH. You could map a network drive on the Windows Server on which WebFOCUS is installed to the machine that has the images. Then use the APP MAP command to add the network drive to the APPPATH. This way you do not need to copy the image sto the WebFOCUS server.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
March 31, 2009, 09:33 AM
Kamesh
Solution1: I got this from our forum long back.

DEFINE FILE CAR
LOGO/A25=IF COUNTRY EQ 'ENGLAND' THEN 'ib_logo_msold.gif' ELSE
IF COUNTRY EQ 'ITALY' THEN 'testpdfimg.gif' ELSE 'ib_logo1_ms.gif';
END

TABLE FILE CAR
SUM
CAR
COUNTRY
BY LOGO
ON TABLE SET HTMLCSS ON
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
$
TYPE=DATA, COLUMN=N1, IMAGE=(LOGO),SIZE=(2.0 .5),$
ENDSTYLE
END

Solution2: As Mgrackin suggested and it works great. Add this code in to your edasprof.prf.
APP MAP testimg C:\Webfocus71\Image
APP PATH Masters ibisamp test testimg

Hope it helps.


WFConsultant

WF 8105M on Win7/Tomcat
March 31, 2009, 09:45 AM
Francis Mariani
Kamesh, thanks for your reminder posting - I did not know about the style-sheet image based on data trick.


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
March 31, 2009, 09:57 AM
JDroke
Yes - this is how I did it (with the DATA trick). The code that was posted looks almost exactly like the example I got mine from that Darin Lee posted. It would be nice if the threads showed the year so you could tell how old they are when you are looking at things - especially in the search.

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


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
March 31, 2009, 01:31 PM
JDroke
I did get this working with the APP MAP to a physical drive on the server so the concept works - I'm just having trouble getting it to work with a mapped drive on the server which must have something to do with security.


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
April 01, 2009, 07:21 AM
JDroke
I got this working on the mapped drive by using the Universal Naming Convention.

This app is a one time need for this mapping. Is there any problem with me putting the APP PATH and APP APPENDPATH is the fex itself - I know it's working but are there any downsides?

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


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
April 01, 2009, 08:06 AM
GamP
You mean with drive letters that have been mapped using the filesystem's 'net use' command?
Such as 'x:\'?
I don't think it will work - but I've been known to be wrong before. . .

But, having said that, that is valid only for drives that have been mapped outside of the server. If you do it from within the server, then the drive will be recognized and you can use it. To set this as a standard drive, add it to the edasprof.
You could for example put the following lines in your edasprof:
! NET USE X: \\servername\D$ 123456 /USER:servername\administrator
APP MAP mymap X:\ibi\apps\appfolder
APP PREPENDPATH mymap

(Change whatever is necessary). As of now the app mymap is available to you.

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 01, 2009, 08:21 AM
JDroke
Sorry GamP. I found my answer and edited the post (evidently while you were typing your reply). Thanks for the info. Any problem with the APP PATH in the fex?


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
April 01, 2009, 09:10 AM
GamP
I personally would use APP PREPENDPATH or APP APPENDPATH.
APP PATH removes the current setting and replaces it with what you type after it.
The other two just add your new app directory to the path as either first or last directory.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 01, 2009, 09:19 AM
JDroke
Sorry GamP, I typed that in wrong. I meant is it okay to put the APP MAP and APP APPENDPATH (as recommended earlier in the thread) in the fex if it's just a one time deal (vs. putting it in the EDASPROF.PRF)?


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
April 01, 2009, 10:59 AM
Francis Mariani
Sure, I see no reason not to put the APP MAP and APP APPENDPATH commands in the fex - they will only be active while the fex runs.


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
April 01, 2009, 12:20 PM
JDroke
Thanks to everyone for their replies!


________________________________________________________________________________________
WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400