Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Images in PDF report.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Images in PDF report.
 Login/Join
 
Platinum Member
posted
Hi,

Please anyone help me in this topic.

I have few images defined in a table as follows:
REDIMG/A90 =
'<img src=http://servername/images/red.gif height=9></img>';
GRIMG/A90 =
'<img src=http://servername/images/green.gif height=9></img>';

Then I have one field which takes these images based on some coditions as follows:

RATE/A90 = IF (CALWEEK EQ 'MWEEK')THEN REDIMG ELSE GRIMG;

Finally i am printing this field to PDF as follows:
TABLE FILE CAR
PRINT RATE
ON TABLE PCHOLD FORMAT PDF
END

But in the output the images are not coming but only the path. How can I get the images as output when I export to PDF?

I cannot specify the image file directly as:
TYPE=HEADING, IMAGE=red.gif ,$

I want the images as a field in the table.

Thanks in Advance!
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Virtuoso
posted Hide Post
I do not think you can include images into a PDF document by specifying the URL/Directory for the image in a FIELD. You have to indicate the URL/Directory location for the image in the FOCUS STYLESHEET for the report.
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Virtuoso
posted Hide Post
Try using a when clause in the FOCUS STYLESHEET to determine when to show which image in your report instead of using a DEFINE field. This might work.
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Silver Member
posted Hide Post
I have run into this problem, and I have yet to find a way to get the images printed with Focus directly to a pdf. However, I have come up with an easy workaround:

I hold the output in HTML format and then run it through a pdf converter program called HTMLDOC. The advantage of using this program is that it is callable from DOS, so I use a DOS command in my fex to take the html output generated and create the pdf. Then, I use an HTMLFORM in the fex to pick up the pdf generated. The conversion happens very quickly, so there is no real lag in performance.
 
Posts: 44 | Location: New York City | Registered: May 23, 2004Report This Post
Gold member
posted Hide Post
The other workaround is to also copy the image file on your Focus Report Server (apps/your folder). That's what I'm doing to be able to see the company logo either in HTML or PDF format. I haven't found a way to show the picture in Excel though.
 
Posts: 87 | Location: Montreal, QC, Canada | Registered: September 03, 2004Report This Post
Expert
posted Hide Post
HTMLDOC is so cool! the site, for downloading is http://www.easysw.com/htmldoc
thanks for that tip!
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
Steve C, could you post sample code for how you do this?, (don't want to reinvent the wheel.... Wink )
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Platinum Member
posted Hide Post
The following is a section of the WF documentation. It is said that the image can be a field in the table column and the column must be specified using the column attribute.

Anybody knows the syntax of this? Please provide an example with one image field in the PRINT.
Simply a column name is throwing ERROR.

GIF image files are now supported in PDF and PS files. The GIF image file must reside on the WebFOCUS Reporting Server and be listed on the EDAPATH.
You can attach a GIF image to the entire report or to one of the following report components:
. Report heading or footing.
. Page heading or footing.
. Sort heading or footing.

Syntax How to Embed a GIF Image in a PDF or PS File
TYPE= {REPORT|heading}, IMAGE={filename.gif|(columnname)}, POSITION=(x y),
SIZE= (w h), $
Where:
TYPE
Identifies the report component. The TYPE attribute and its value must appear at the beginning of the declaration.
REPORT
Enables you to attach the graphical image to the entire report.
Heading
Enables you to attach the graphical image to the following:
. A report heading or footing (TABHEADING, TABFOOTING).
. A page heading or footing (HEADING, FOOTING).
. A sort heading or footing (SUBHEAD, SUBFOOT).
IMAGE
Specifies a GIF image file. The GIF image file must reside on the WebFOCUS Reporting Server and listed on the EDAPATH.

Column
Specifies an alphanumeric field in the report (either a BY field or a verb object) whose value corresponds to the name of the image file. Select a column using the COLUMN attribute. Note that the column indicator must be enclosed in parentheses.
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Platinum Member
posted Hide Post
Steve C,
Could you post sample code for using HTMLDOC from within the fex.
Thanks.


App Studio Version 8202
windows Platform
SQL Server 2008/2012
 
Posts: 183 | Location: TX | Registered: January 22, 2007Report This Post
Expert
posted Hide Post
Cyril,

You would think the following would work, wouldn't you? I followed the manual and came up with the code below - it does not work for PDF. Comment the ON TABLE PCHOLD command and the images show up in the HTML report, which means my image definition is correct.

DEFINE FILE CAR
CIMG_ID/A20 = DECODE COUNTRY ('ENGLAND' 'excel_logo', 'FRANCE' 'graph_logo' 'JAPAN' 'html_logo' ELSE 'pdf_logo');
CIMG/A200   = '/approot/ibinccen/' || CIMG_ID || '.gif';
END

TABLE FILE CAR
SUM
CIMG NOPRINT
SALES
BY COUNTRY NOPRINT
ON COUNTRY SUBHEAD
"<COUNTRY"

ON TABLE PCHOLD FORMAT PDF

ON TABLE SET STYLESHEET *
TYPE= SUBHEAD, IMAGE=(CIMG), $
END


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Guys (and Gals),

The code that Francis posted works for HTML output because the image tag that is returned looks for /approot/... on the web server after returning the HTML to the browser. In other words, the pulling of the image from the web server is down by the browser after the results are returned. WF does not put the image in the results, just the hyper link to the image so the browser can retrieve it. therefore the "/approot/ibinccen/..." works for HTML.

However, for this to work for PDF output format you need a fully qualified directory path to the image file. Try replacing the "/approot" with "&APPROOT" so your statement looks like:

... '&APPROOT/ibinccen/' ...

&APPROOT should exist as a variable by default so you do not need to create it.

FYI, on my install the images are one directory further down in an "images" directory.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Member
posted Hide Post
This may help:
I had a similar issue when trying to get a graph to go lanscape in a PDF. NOTE: This starts with the SAVE of the current display.
===
ON GRAPH SAVE AS GRAPH1 FORMAT GIF
END
DEFINE FILE LSTOSCRP
BEGWEEK/YYMD = '&PSUN';
BWK/MDY = BEGWEEK;
END
TABLE FILE LSTOSCRP
HEADING CENTER
"Materials Scrap for the week of BY DOLWK2 NOPRINT
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY OFF
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Letter',
LEFTMARGIN=1.500000,
RIGHTMARGIN=1.500000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,$
TYPE=REPORT,
FONT='TIMES NEW ROMAN',
SIZE=32,
COLOR=BLACK,
BACKCOLOR=NONE,
STYLE=BOLD,$
TYPE=TITLE,
GRID=ON,
BACKCOLOR=SILVER,$
TYPE=REPORT,
IMAGE=GRAPH1.gif,
POSITION=(.5000000 0.00000),
SIZE=(11.00000 8.50000),$
END
===
If you can display in an alternate format you may be able to save that as GIF and then read it in and display as a PDF


Robert B. Clark -- Business Systems Analyst
Daimler Trucks North America
Phone: 503.745.7057
"There's always a better way."
IBM Mainframe zOS 8.1.05, DB2 adapter
WF 8.1.05 Hub to Sub, Self-Service, SQL Server adapter
 
Posts: 25 | Location: Portland, OR | Registered: October 13, 2006Report This Post
Expert
posted Hide Post
Mickey,

The documentation states
quote:
PDF or PS report:


Is the name of the image file. It must reside on the WebFOCUS Reporting Server in a directory named on EDAPATH or APPPATH. If the file is not on the search path, supply the full path name.


When specifying a GIF file, you can omit the file extension.
Wouldn't this mean that we could use a relative path and not the full path?

Actually this may mean that we simply need to specify the image file name without a path, non?

Cheers,


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Peeps, Peeps,

You are not thinking in a two server mindset.

When using images from within WebFOCUS locations and servers (e.g. excluding URL references) -

For HTML and Excel output the image must be referenced from the Client server (the one that is running the Web Server and Web Apps service)

For PDF (etc.) the file must exist in the App path (APPROOT or EDAPATH) as the PDF file is self contained and therefore all references to components MUST be applicable on the server within which it is compiled - e.g. the Reporting Server.

All of the above posts are relevant BUT you must think in a two server mindset! Then it becomes easy(?!?)

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, 2004Report This Post
Virtuoso
posted Hide Post
Francis,

YES, you are right. I forgot about that. If the image file is in the APPPATH/EDAPATH on the WF SERVER then all you need to do is specify the image filename in the code for the PDF output format. You do not need to include the fully qualified directory path.

Here's an example:

I have a directory called IMAGES under the BASEAPP directory. The IMAGES directory is in my APPPATH. In addition, the BASEAPP directory is defined as a virtual directory to Microsoft's IIS. All components are on the same Windows Server (IIS, WF Client, WF Server).

The following code works for both formats.

The BASEURL eliminates the need to specify the full URL in the stylesheet. MAKE SURE YOU HAVE THE ENDING "/" ON THE BASEURL.

The BASEURL does nothing for the PDF format.

SET BASEURL=HTTP://IISSERVER.COM/BASEAPP/IMAGES/

TABLE FILE CAR
PRINT RCOST DCOST
BY COUNTRY
BY CAR
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, IMAGE=BANNER.GIF,$
END


I think I need to write a PART 3 article for WebFOCUS Report Design for HTML and PDF. What do you think, Tony?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
Yes Mickey, Please do write that part 3 article!


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Without moving my lips Big Grin

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, 2004Report This Post
Expert
posted Hide Post
mick,
cyril's orig question was slightly diff...
how to use images as actuals fields into a pdf report, not just how to find them for TYPE=REPORT or TYPE=SUBHEAD, but as TYPE=DATA.
so, i'm wondering if the COMPOUND PDF stuff in 7n will allow the creation of a complex multiimage output, of the sort so simple in html.
If you could tackle that in Part3...i'll oh so gladly email you the images for the car file ...
I'm a fan.
-s




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
I just noticed that this thread started in SEPT of 2004!!!

As far as I know, there still is no way to put an image in a column for PDF output, let alone changing it dynamically on a row by row basis.

However, the following is a sample of how you might create a color in a column using BACKCOLOR.

TABLE FILE CAR
SUM SALES
COMPUTE COLOR/I1=IF (SALES GE 50000) THEN 0 ELSE 1; NOPRINT
COMPUTE IMCOL/A1=''; AS ''
BY COUNTRY
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=ON,$
TYPE=REPORT, COLUMN=IMCOL, SQUEEZE=0.20,
LEFTGAP=0.00, RIGHTGAP=0.00,$
TYPE=DATA, COLUMN=IMCOL, BACKCOLOR=RED, WHEN=COLOR EQ 1,$
TYPE=DATA, COLUMN=IMCOL, BACKCOLOR=GREEN, WHEN=COLOR EQ 0,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
Based on a COMPUTE, this calculates an image to be placed in a SUBHEAD.

The images are in the APPPATH.

DEFINE FILE CAR
CIMG/A20 = DECODE COUNTRY ('ENGLAND' 'EXCEL_LOGO.GIF', 'FRANCE' 'GRAPH_LOGO.GIF' 'JAPAN' 'HTML_LOGO.GIF' ELSE 'PDF_LOGO.GIF');
END

TABLE FILE CAR
SUM
CIMG NOPRINT
SALES
BY COUNTRY NOPRINT
ON COUNTRY SUBHEAD
" "
" "
" "
" "
"<COUNTRY"
" "

ON TABLE PCHOLD FORMAT PDF

ON TABLE SET STYLESHEET *
TYPE= SUBHEAD, IMAGE=(CIMG), POSITION=(.1 .1), $
END


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
In case anyone would like to read it, the Part 2 article of "WebFOCUS HTML and PDF Report Design" has been posted in the Focus on Developers section of Focal Point.

http://www.informationbuilders.com/support/developers/htmlpdf_part2.html


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
applause, mick!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Susannah,

Thanks for the applause. Unfortunately the version of the article on Focal Point is messed up. It is not formatted correctly and some text from my first article is mixed into the second article. What a mess!

Sorry everyone for the confusion. I have sent emails to IBI to get this corrected. Frowner


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
argh. you're not alone. they did that to mine, as well.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
This time my lips are sealed. Big Grin

J.G.

The articles are good just hope they can be sorted.

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, 2004Report This Post
Virtuoso
posted Hide Post
Had just responded to Jud's post about PDF and CSS, and brain starting working, having seen this topic before.

If you are really serious about wanting to have images, even if somewhat limited, for each row in a PDF output from a TABLE request, then this might help. Could probably do with some refining.

Basically, the report has multiple images positioned down the page, level with the rows of the report. There is nothing complicated with this process, and just a little manipulation of positioning by trial and error.

-* set the top position of the first image on the page, this depends upon headings 
-* and such like
-SET &DOWN=63;
-* the report has to be run twice or through a hold file, once to get the image 
-*and number if records
DEFINE FILE CAR
-*define image here dependent upon your own screening conditions and criteria
IMG/A20 = IF COUNTRY EQ 'ENGLAND' THEN 'THISIMAGE.GIF' ELSE 'THATIMAGE.GIF';
END
-* now run a table request to link image to each record, and save, making sure 
-*the order is the same as final report
TABLE FILE CAR
PRINT
IMG
-* I suppose you could use NOPRINT and HOLDLIST here....
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SAVE
END
-RUN
-* keep number of lines
-SET &LOOP=&LINES;
-* now run actual report
-* use all by fields, or at least by to the lowest level of detail, and put 
-* in a subfoot so that line height can be altered, in the style section, to 
-* fit the images you want.
TABLE FILE CAR
BY COUNTRY
BY CAR
BY MODEL SUBFOOT
" "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
     UNITS=PTS,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
-* set column absolute positions to allow insertion of image where you want it. 
-* This was for Jud's post but is needed here to leave room, somewhere, for the image
TYPE=REPORT,
    COLUMN=N1,
    POSITION=200,
$
TYPE=REPORT,
    COLUMN=N2,
    POSITION=300,
$
TYPE=REPORT,
    COLUMN=N3,
    POSITION=30,
$
-* set the height of the subfoot, this is necessary to allow for image height.  Works for -ve as well as +ve
TYPE=SUBFOOT,
    TOPGAP=5,
$
-* now, luckily, you can wrap DM around style sheet syntax and use &vars within
-REPEAT HOPEFUL &LOOP TIMES
-* read save file for the image you want, remember to get your path for image on your server correct.

-READ SAVE &DUMMY.A50 &IMAGE.A15

-* put the image and down position into the stylesheet. Images used here are 10px by 12px
-* I've got the image on the left, but it could be anywhere.

TYPE=REPORT,IMAGE=&IMAGE,POSITION=(10 &DOWN),$

-*increment the image down position whatever number of pts
-SET &DOWN=&DOWN+25;
-HOPEFUL
ENDSTYLE
END
-RUN


I was slightly amazed that this worked. Copy code and give it a whirl. You could probably wrap this up to work for HTML output as well as PDF, with HTML requiring a lot less work.

This message has been edited. Last edited by: Alan B,


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
I know this is an old thread, but here's one answer... there's a better one, i just lost custody of that server where i tested it..i'll keep looking.

DEFINE FILE CAR
FLAG/A100=DECODE COUNTRY('ENGLAND' '\\localhost\images\england.GIF'
'FRANCE' '\\localhost\images\france.GIF'
'W GERMANY' '\\localhost\images\germany.GIF'
 'ITALY' '\\localhost\images\italy.GIF'
  'JAPAN' '\\localhost\images\japan.GIF');
                          
END
-RUN
TABLE FILE CAR
SUM RCOST
    DCOST
 BY COUNTRY BY FLAG
 BY CAR
 BY MODEL
HEADING
" </4"
 
 ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
 
  TYPE=REPORT, IMAGE=c:\ibi\apps\ibisamp\IWCPOWER.GIF, POSITION=(0 0),   $
type=data, column=flag, image=(flag), size=(.5 .25), preserveratio=on,$
ENDSTYLE
END





In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Images in PDF report.

Copyright © 1996-2020 Information Builders