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     [CASE-OPENED] Images on Graphs in PDF

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CASE-OPENED] Images on Graphs in PDF
 Login/Join
 
<Meghan>
posted
Graph gurus -

With JG's help I was successful at getting an image to display on my graph using the annotation box and setTextureURL but NOW I need to be able to have that graph in PDF. I assumed I could do the same thing but it's not working. What I have in my code is this: generate graph and HOLD it as SVG then reference the SVG file to create the PDF version. I am totally stuck. The only images that WILL show up on my graph in PDF are from the ibi\webfocus76\ibi_html\javaassist\tdg folder which houses actual 'texture' gifs. Even if I throw my gif in this file location it doesn't recognize it and just hangs - no error message. It just does not run.

Help!

This message has been edited. Last edited by: Kerry,
 
Report This Post
Virtuoso
posted Hide Post
How are you referencing the images? The way that images are included in PDf reports is not the same as for HTML. Also the images need to exist somewhere in the server path (including any that are in the current EDATEMP location).


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
<Meghan>
posted
In the HTML version I am referencing them like so (per JGs instruction):

setTextureURL(getAnnotationBox(0), "/images/custom/image.png");
 
Report This Post
Virtuoso
posted Hide Post
That does not work for PDF files. You should refer to the documentation about including graphics in PDF files. As I mentioned the images must be in the server path - they cannot be referenced via URL.


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
I have to say I have never enjoyed the fact that most everything works differently depending on the output type. If you have selected a presentation type of output (PDF, EXL2K, PowerPoint, HTML) then the code ought to be the same and the software should take care of producing the different output formats. (this mini-rant doesn't help here, sorry)


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
<Meghan>
posted
Yes, I realize that image references are different in PDFs vs. HTML but technically I'm running the whole graph with an imbedded image into a HOLD image, then calling that HOLD image in the PDF. So technically the imbedded image should already be there. I've read all documentation regarding image calls in PDFs but since this is a different type of image call altogether then I'm a little perplexed.
 
Report This Post
Expert
posted Hide Post
Meghan,

The obvious check is to locate your SVG image on the network and see if it will open in something such as Photoshop or the like.

If it opens then you know the problem is likely to lie with the WebFOCUS arena, if it doesn't open then you know the image is suspect.

What type of PDF document are you using? I've recently had problems with some gif, jpg and svg images in the new compound syntax (but not all - and they all open OK).

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
<Meghan>
posted
Tony,

Unfortunately I don't have a program that allows me to look at the SVG image. But here's what stumps me:

If I reference one of the IBI texture files (example yellow.gif found in: //server/ibi/webfocus76/ibi_html/javaassist/images/tdg) the entire thing runs smoothly. I am able to HOLD the SVG file of my graph with the imbedded image that I can then reference in a PDF. Now, when I reference the image that I want (found in: //server/ibi/webfocus76/ibi_html/javaassist/images/custom - or even if I throw it into the tdg folder) it does not work. I've run across two scenarios - 1) the SVG file is created and then it's referenced in the PDF just fine but the image is not there at all - like it simply ignored those command lines or 2) the processing of the entire fex just hangs. I can leave it for several minutes and it will never run.

As for 'what kind of PDF document' I am using...I'm not really sure I know how to answer that question. Here's the code that is at the end of my fex that creates the PDF:

TABLE FILE SYSCOLUM
" "
SUM TBNAME NOPRINT
ON TABLE SET PAGE-NUM NOLEAD
IF READLIMIT EQ 1
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
type=HEADING, IMAGE=PDFTEST.SVG, position=(0 0), $
TYPE=REPORT,PAGE-LOCATION=OFF,$
END  
 
Report This Post
<JG>
posted
Meghan, SVG is very different from other image formats. Try using gif or jpeg.
 
Report This Post
<Meghan>
posted
JG,

I have tried both GIF and JPEG with no luck. The ending pdf will show my graph but it will not show my imbedded gif within the graph.
 
Report This Post
Expert
posted Hide Post
We should work with an example.

Here's a fex that successfully displays a SVG graph in a PDF report, but I can't get the image to display on the graph - I probably have incorrectly coded the file path for the images.

GRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH VBRSTK1
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH HOLD AS HOLDGR1 FORMAT SVG
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(true);
setConnectLineMarkers(false);
setConnectScatterMarkers(false);
setO1LabelDisplay(true);
setO1AxisSide(0);
setO1MajorGridDisplay(true);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,1);
setY1LabelDisplay(true);
setY1AxisSide(0);
setY1MajorGridDisplay(true);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(1);
setSeriesDefaultTransparentBorderColor(true);
setUseSeriesBorderDefaults(true);
setLegendDisplay(true);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
-* Use image in bars
setTextureURL(getSeries(0),"file:C:\ibi\WebFOCUS76\ibi_html\javaassist\tdg\graphics\pattern_17.gif");
setTextureURL(getSeries(1),"file:C:\ibi\WebFOCUS76\ibi_html\javaassist\tdg\graphics\pattern_17.gif");
setTextureURL(getSeries(2),"file:C:\ibi\WebFOCUS76\ibi_html\javaassist\tdg\graphics\pattern_17.gif");
setTextureURL(getSeries(3),"file:C:\ibi\WebFOCUS76\ibi_html\javaassist\tdg\graphics\pattern_17.gif");
setTextureURL(getSeries(4),"file:C:\ibi\WebFOCUS76\ibi_html\javaassist\tdg\graphics\pattern_17.gif");
setDisplayBarAsPictograph(true);
ENDSTYLE
END
-RUN

TABLE FILE CAR
PRINT
COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1

HEADING
""
FOOTING
""
ON TABLE SET PAGE NOLEAD
ON TABLE PCHOLD FORMAT PDF

ON TABLE SET STYLE *
TYPE=REPORT, IMAGE=holdgr1.svg, $
ENDSTYLE
END
-RUN


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
Corrections to the graph java code:

-* Use image in bars
setTextureDisplayMode(0);
setFillType(getSeries(0),3);setTextureURL(getSeries(0),"/images/tdg/Azul_Granite.gif");
setFillType(getSeries(1),3);setTextureURL(getSeries(1),"/images/tdg/Azul_Granite.gif");
setFillType(getSeries(2),3);setTextureURL(getSeries(2),"/images/tdg/Azul_Granite.gif");
setFillType(getSeries(3),3);setTextureURL(getSeries(3),"/images/tdg/Azul_Granite.gif");
setFillType(getSeries(4),3);setTextureURL(getSeries(4),"/images/tdg/Azul_Granite.gif");
setDisplayBarAsPictograph(true);

This now works: it uses texture images in tdg as background images in the graph bars AND the PDF displays the SVG graph - Windows XP 2002 SP2, WebFOCUS 7.6.5, Apache Tomcat 5.


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
The same program fails on the AIX environment with these errors:

 0 NUMBER OF RECORDS IN GRAPH=       18  PLOT POINTS=      5
 (FOC3230) HTTP REQUEST FOR GRAPHSERVURL RETURNED ERROR: ???
 SVG FILE SAVED ...
 0 ERROR AT OR NEAR LINE     72  IN PROCEDURE graphimage1
 (FOC3251) IMAGE FILE UNREADABLE OR INVALID: holdgr1.svg (RC=1)
 0 ERROR AT OR NEAR LINE     72  IN PROCEDURE graphimage1
 (FOC3251) IMAGE FILE UNREADABLE OR INVALID: holdgr1.svg

This may be due to graph settings usually set using the Admin Console but I do not have access to it for the Prod AIX server.


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
Francis, your code with the corrected bit added worked on my AIX 5.3 box with a 7.6.5 client. I wonder what is different.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
It appears only gif files can be referenced in the setTextureURL. I tried bmp, gif, jpg, png, svg and tif - only gifs displayed

DisplayBarAsPictograph

By the way, Firefox can display SVG files.


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
Ginny,

I'm not sure what the issue could be.

The graph engine on both servers is set to GRAPH53.

We have WF 7.6.5 on AIX 5.2.


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
<Meghan>
posted
Francis,

You are correct - it works ONLY when you use the texture images in tdg but I need it to be able to work with ANY gif image and technically it 'should'. I've opened a case so we'll see if they can resolve the issue.

Meghan
 
Report This Post
Expert
posted Hide Post
Meghan,

I reference a gif I put in a subfolder in tdg and it works :

-* Use image in bars
setTextureDisplayMode(0);
setFillType(getSeries(0),3);setTextureURL(getSeries(0),"/images/tdg/francis/arrowu5.gif");
setFillType(getSeries(1),3);setTextureURL(getSeries(1),"/images/tdg/francis/arrowu5.gif");
setFillType(getSeries(2),3);setTextureURL(getSeries(2),"/images/tdg/francis/arrowu5.gif");
setFillType(getSeries(3),3);setTextureURL(getSeries(3),"/images/tdg/francis/arrowu5.gif");
setFillType(getSeries(4),3);setTextureURL(getSeries(4),"/images/tdg/francis/arrowu5.gif");
setDisplayBarAsPictograph(true);


The images must be gif format and they must be located in C:\ibi\WebFOCUS76\ibi_html\javaassist\images\tdg or subfolder.

Being limited to gifs seems to defeat the purpose of high-res SVG graphs as the gifs look like ¢r@p.


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
I don't know if that is completely true, Francis. I have a focexec with this line in it and it works just fine:
setTextureURL(getSeries(0),"http://myserver/approot/ibidemo/bg2.jpg");

Neither in tdg or a .gif.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<Meghan>
posted
Francis,

I even copied your code, tried putting my gif in the TDG folder, also tried adding a subfolder called 'custom' and puttin gmy gif in there - the procedure still hangs. It must be some sort of setting that I have that won't work.

Meghan
 
Report This Post
Expert
posted Hide Post
Meghan, have you checked the Graph settings on the Admin Console?

ENABLE_SSG: YES
IBIF_graphengine: GRAPH53
IBIF_graphservurl: &URL_PROTOCOL://&SERVER_NAME:&SERVER_PORT&IBIF_webapp/IBIGraphServlet
IBIF_graphAgents: 10
SSG_EXTERNAL: NO
IBIJAVADIR:
IBIJAVACMD: java


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
<Meghan>
posted
Francis,

The only difference in my settings is the IBIF_graphservurl but I was instructed to remove any text in this field to resolve another unrelated issue. If I put it back in I get all sorts of errors with PDFs.
 
Report This Post
<Meghan>
posted
Ginny,

If your procedure is producing an HTML output then you can have it anywhere and it can be any type of file. My HTML version of this procedure works just fine and it's in a 'custom' folder (not tdg) and it is a png file. Works great. PDF is where the hiccup is.
 
Report This Post
Expert
posted Hide Post
Thanks for the clarification. However, I did run Francis' code and it worked fine. Good luck!


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report 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     [CASE-OPENED] Images on Graphs in PDF

Copyright © 1996-2020 Information Builders