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     [CLOSED] Image in row of a PDF report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Image in row of a PDF report
 Login/Join
 
<Arun>
posted
Hi all,

I need to create a report which has images in its rows. The code is working fine for HTML. But when i try to create it in PDF the source location of the image is printed instead of the image. Can anyone help me to resolve this issue?

HTML Code :

TABLE FILE CAR
PRINT
*
ON TABLE HOLD
END

TABLE FILE HOLD
SUM
COMPUTE IMG/A50= IMAGE location ; NOPRINT
COUNTRY
CAR
MODEL
BY IMG AS 'IMAGE'
ON TABLE PCHOLD FORMAT HTML
END


OUTPUT :
IMAGE | COUNTRY | CAR | MODEL
image.GIF | FRANCE | PEUGEOT | 504 4 DOOR

-**********************************************

PDF Code :

TABLE FILE CAR
PRINT
*
ON TABLE HOLD
END

TABLE FILE HOLD
SUM
COMPUTE IMG/A50=IMAGE location; NOPRINT
COUNTRY
CAR
MODEL
BY IMG AS 'IMAGE'
ON TABLE PCHOLD FORMAT PDF
END


OUTPUT :
IMAGE | COUNTRY | CAR | MODEL
image location | FRANCE | PEUGEOT | 504 4 DOOR

This message has been edited. Last edited by: FP Mod Chuck,
 
Report This Post
Virtuoso
posted Hide Post
Images in HTML reports and images in PDF reports are two completely different things. iI don't think there is one single piece of code that can be used for both. A PDF report does not know anything about a location, while an HTML report can use an HREF/URL or something of that sort. Your best bet is probably to use some Dialogue Manager to determine which code will be used depending on the desired output.


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
Your code needs to be placed between
[code]
[/code]
tags for it to be displayed properly in this forum.

You cannot place images in a PDF report using what I suspect to be HTML code in that COMPUTE statement. Images are placed in PDF reports using WebFOCUS stylesheet commands. Here's an example:

TABLE FILE CAR
SUM
SALES
BY COUNTRY

HEADING
"WEBFOCUS REPORT"

ON TABLE PCHOLD FORMAT PDF

ON TABLE SET STYLESHEET *
TYPE=HEADING, IMAGE=d:\ibi\apps\baseapp\alerticon.gif, $
ENDSTYLE
END

It appears you cannot add images to a data row using this method.

TYPE={REPORT|heading}, IMAGE={url|file|(column)}[,POSITION=([+|-]x [+|-]y )] [,SIZE=(w h)] , $

only allows for
quote:
REPORT - Embeds an image in the body of a report. The image appears in the background of the report. This value is the default.

heading - Embeds an image in a heading or footing. Valid values are TABHEADING, TABFOOTING, FOOTING, HEADING, SUBHEAD, and SUBFOOT.

Provide sufficient blank space in the heading or footing so that the image does not overlap the heading or footing text. Also, you may want to place heading or footing text to the right of the image using spot markers or the POSITION attribute in the StyleSheet.



You may have luck searching for image and PDF in this forum, someone may have come up with another method.


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
You can add images to a data row using the following. The images must be available in your server's apppath. IMAGE1, IMAGE2, etc are the names of the GIF image files. If there is a field that already contains the name of the desired image, then you're that much closer.
DEFINE FILE CAR
LOGO/A15=IF COUNTRY EQ 'ENGLAND' THEN 'IMAGE1' ELSE 
         IF COUNTRY EQ 'ITALY' THEN 'IMAGE2' ELSE 'IMAGE3';
END
TABLE FILE CAR
SUM
 CAR
 LOGO
BY COUNTRY
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=N3, IMAGE=(LOGO),SIZE=(2.0 .5),$
ENDSTYLE
END



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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
Darin,

Thanks for that example. It is strange that both the 5.3 and 7.6 documentation do not suggest that DATA is one of the stylesheet TYPEs that can have an image applied to, unless I missed something.


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
That is interesting and I don't think I ever really thought about that. I just stuck it in there one day and it worked so life was good. Just one of those bonus features that never shows up in the docs. Now if it's one of those things that disappears one day after an upgrade, I'll have more to say on the subject.


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
<Arun>
posted
Darin,

Your code perfectly suites my requirement. Thankyou for the sample.
 
Report This Post
Expert
posted Hide Post
Here's how i discovered it: if you use GRAPHTYPE and then output that to PDF,
it works.
so you back into how to do it by defining variables. the key is that in defining a string variable that is the location of an image,
don't use the full url,
don't use "src='http://...blabla'"
Make sure your BASEURL is pointing to where your images are...you'll see when you crack open a GRAPHTYPE.

The problem with images as data rows is this:
if the image is a BY field
and say you have 3 rows of data next to it
BY COUNTRY BY FLAGPIC BY CAR
...
if the FLAGPIC is 50 pixels high, then Every row in the CAR column will be 50 pixels high. Its horrid. I've been asking forEVER that this be addressed ... and nobody cares.
Cognos does it easily, and also allows the FLAGPIC to appear as 'rowspan=n', very handy,
in both html and pdf.

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




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
HERE'S the kicker
type=data, column=flagpic, image=(flagpic), size=(0.5 0.25), preserveratio=on,$

size is height width; height takes precendence, if you set a width, it will be ignored (thankfully) if you say 'preserveratio=on'
which you will be tempted to type as 'preservation' or 'prereservation' or some other gibberish until you figure out it is supposed to be 'preserve ratio'
sigh.
but if you get it right, it'll work, otherwise your pictures might be morphed..which might be more fun.

now if anyone can find that in the doc, a beer to you at summit!




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
Platinum Member
posted Hide Post
Darin Lee..i have a question.

I have my image1 in /approot/images/rpt/image1.png and image2 in
/approot/images/rpt/image2.png.

As per your code ;
where do i give this url?
should i not use image tag?
or i have give '/approot/images/rpt/image1.jpg' instaed of 'IMAGE1' in the if conditon.?


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
 
Posts: 229 | Location: MI | Registered: September 13, 2017Report This Post
Virtuoso
posted Hide Post
srajeevan

Darin no longer is active on Focal Point. So I suggest you open a case with techsupport since no one else has provided an answer.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Platinum Member
posted Hide Post
quote:
or i have give '/approot/images/rpt/image1.jpg' instaed of 'IMAGE1' in the if conditon.?

set BASEURL
I.E.
 SET BASEURL = <DIRECTORY>:\IBI\APPS\IMAGES\RPT\ 
DEFINE FILE CAR
LOGO/A15=IF COUNTRY EQ 'ENGLAND' THEN 'IMAGE1' ELSE 
         IF COUNTRY EQ 'ITALY' THEN 'IMAGE2' ELSE 'IMAGE3';
END


WF Production :- WF:8.0.0.4, 8.1.05 App-studio/Developer Studio(8.1.x) ,
8.2.0.1M , 8.2.0.2 (App-Studio8.2.x),
InfoAssist/+, InfoDiscovery
Output format:-AHTML, PDF, Excel, HTML
Platform:-Windows 7, 8,10
 
Posts: 186 | Location: Infobuild India | Registered: August 28, 2015Report 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     [CLOSED] Image in row of a PDF report

Copyright © 1996-2020 Information Builders