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.
Question/Specific Challenge: I have 32 images, and I need one to populate dynamically based on user selection from a list.
I can get one image for one store to populate correctly in a fex. Here's that code: TABLE FILE STORE_DIRECTORY PRINT IMAGE NOPRINT STORE_DIRECTORY.STORE_DIRECTORY.STORE_NAME NOPRINT WHERE STORE_DIRECTORY.STORE_DIRECTORY.STORE_NAME EQ 'Grocery Store' ON TABLE SUBHEAD "" ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * $ TYPE=TABHEADING, IMAGE=IBFS:/WFC/Repository/Stores/Images/grocery_store_logo.gif, POSITION=(+3.0 +0.00), $ ENDSTYLE END
This code attempts to make the images populate dynamically. Right now I get the image names but not the images themselves. -DEFAULT &STORE_NAME = 'Grocery Store'
-SET &ECHO=ALL;
DEFINE FILE STORE_DIRECTORY
IMAGE/A250 = IF STORE_NAME EQ 'Clothing Store' THEN '' ELSE ''; END
TABLE FILE STORE_DIRECTORY PRINT IMAGE NOPRINT BY STORE_DIRECTORY.STORE_DIRECTORY.STORE_NAME NOPRINT WHERE STORE_DIRECTORY.STORE_DIRECTORY.STORE_NAME EQ '&STORE_NAME' ON TABLE SUBHEAD "ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty, $ ENDSTYLE END
I suspect (after reading several posts including this one from 2009 at http://forums.informationbuild...5491/xsl/print_topic) the issue probably resolves around the images' storage location, but I could be wrong about that. My understanding is that I might need to move the images to a different folder. Either that, or per the documentation, "The image 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."This message has been edited. Last edited by: JulieA,
I have the following where my image reside on the a server from a public drive
TABLE FILE CAR
SUM COMPUTE SUMSEATS /P5 = SEATS;
COMPUTE IMAGE /A150 = IF SUMSEATS GT 10 THEN '<IMG SRC="file:\\<FileLocationOnServer>\acrobat_small.gif" style="border-style: none;" alt="Excel">'
ELSE '<IMG SRC="file:\\<FileLocationOnServer>\excel_small.gif" style="border-style: none;" alt="PDF">';
BY COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
ENDSTYLE
END
-RUN
Note that image used are not relevant with the sample :-)
The IMAGE computed field can be used anywhere but it will have the last computed value if used in header or footing.
Something similar could probably work using the IBFS
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE COUNTRY EQ 'JAPAN'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=REPORT, WHEN= COUNTRY EQ 'ENGLAND',
IMAGE=IBFS:/WFC/Repository/untitled/images/england-flag.gif, $
TYPE=REPORT, WHEN= COUNTRY EQ 'FRANCE',
IMAGE=IBFS:/WFC/Repository/untitled/images/france-flag.gif, $
TYPE=REPORT, WHEN= COUNTRY EQ 'ITALY',
IMAGE=IBFS:/WFC/Repository/untitled/images/italy-flag.gif, $
TYPE=REPORT, WHEN= COUNTRY EQ 'JAPAN',
IMAGE=IBFS:/WFC/Repository/untitled/images/japan-flag.gif, $
TYPE=REPORT, WHEN= COUNTRY EQ 'W GERMANY',
IMAGE=IBFS:/WFC/Repository/untitled/images/germany-flag.gif, $
ENDSTYLE
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
Documentation: Creating Reports With WebFOCUS Language > Laying Out the Report Page > Adding an Image to a Report
Of course, the examples are not precise enough, particularly the one about using a computed column.
TABLE FILE CAR
SUM
SALES
COMPUTE IMAGE_LOCATION/A100 =
IF COUNTRY EQ 'ENGLAND' THEN 'IBFS:/WFC/Repository/untitled/images/england-flag.gif'
ELSE IF COUNTRY EQ 'FRANCE' THEN 'IBFS:/WFC/Repository/untitled/images/france-flag.gif'
ELSE IF COUNTRY EQ 'ITALY' THEN 'IBFS:/WFC/Repository/untitled/images/italy-flag.gif'
ELSE IF COUNTRY EQ 'JAPAN' THEN 'IBFS:/WFC/Repository/untitled/images/japan-flag.gif'
ELSE IF COUNTRY EQ 'W GERMANY' THEN 'IBFS:/WFC/Repository/untitled/images/germany-flag.gif'
ELSE ''; NOPRINT
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE COUNTRY EQ 'JAPAN'
ON TABLE SUBHEAD
""
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=TABHEADING, IMAGE=(IMAGE_LOCATION), $
ENDSTYLE
END
This should work, but does not, probably because of the image location. The example does not specify where the images should be, and it's ridiculous that one method works while another does not.
This works, when the images are in an app folder on the reporting server:
TABLE FILE CAR
SUM
SALES
COMPUTE IMAGE_LOCATION/A100 =
IF COUNTRY EQ 'ENGLAND' THEN 'test/england-flag.gif'
ELSE IF COUNTRY EQ 'FRANCE' THEN 'test/france-flag.gif'
ELSE IF COUNTRY EQ 'ITALY' THEN 'test/italy-flag.gif'
ELSE IF COUNTRY EQ 'JAPAN' THEN 'test/japan-flag.gif'
ELSE IF COUNTRY EQ 'W GERMANY' THEN 'test/germany-flag.gif'
ELSE ''; NOPRINT
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE COUNTRY EQ 'JAPAN'
ON TABLE SUBHEAD
""
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=TABHEADING, IMAGE=(IMAGE_LOCATION), $
ENDSTYLE
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
Francis, that the first version doesn't work might be due to the fact that the generated image tag appears to have the wrong image format. The images are GIFs, but the img tag reads:
Also; the base64 encoded contents are missing from that tag. Odd!
Perhaps this does actually work for PNG images?
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
COMPUTE IMAGE_LOCATION/A100 = IF COUNTRY EQ 'ENGLAND' THEN 'IBFS:/WFC/Repository/untitled/images/england-flag.gif' ELSE IF COUNTRY EQ 'FRANCE' THEN 'IBFS:/WFC/Repository/untitled/images/france-flag.gif' ELSE IF COUNTRY EQ 'ITALY' THEN 'IBFS:/WFC/Repository/untitled/images/italy-flag.gif' ELSE IF COUNTRY EQ 'JAPAN' THEN 'IBFS:/WFC/Repository/untitled/images/japan-flag.gif' ELSE IF COUNTRY EQ 'W GERMANY' THEN 'IBFS:/WFC/Repository/untitled/images/germany-flag.gif' ELSE '';
My impression is that "IBFS:/WFC/Repository/..." is meaningless to the reporting server -- such references in Repository fex code must be snared and transformed by Client into syntax that Reporter can handle, referring to objects that Client ships along with the fex code.
(I don't have access now, but can you test: Does
ON TABLE SET STYLE *
TYPE=TABHEADING, IMAGE='IBFS:/WFC/Repository/untitled/images/england-flag.gif', $
ENDSTYLE
get sent by Client verbatim to Server to execute?)
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
The solution you provided yesterday including the subsequent information provided today at 10:35 a.m. worked well except for two tiny issues. The first issue seems odd.
I don't have access to the CAR file. I've made my code generic below.
Here's the issue: Let's suppose I have one store called Grocery Store of Kansas. I have a second store called Grocery Store of Kansas Deli.
When I use the drop down list and select Grocery Store of Kansas, I get the images for both Grocery Store of Kansas and Grocery Store of Kansas Deli. When I select Grocery Store of Kansas Deli, I get just that image.
Here's my code:
-IF &STORE_NAME EQ '_FOC_NULL' THEN GOTO ALLSTORES ELSE GOTO STORE;
-ALLSTORES TABLE untitled STORE_DIRECTORY PRINT STORE_DIRECTORY.STORE_ID NOPRINT ON TABLE SUBHEAD " " WHERE STORE_DIRECTORY.STORE_DIRECTORY.STORE_ID EQ '1'; ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * $ TYPE=REPORT, JUSTIFY=LEFT, $ TYPE=TABHEADING, LINE=1, JUSTIFY=LEFT, $ TYPE=REPORT, COLUMN=N2, BORDER-TOP=OFF, BORDER-BOTTOM=OFF, BORDER-LEFT=OFF, BORDER-RIGHT=OFF, $ ENDSTYLE END -RUN -EXIT
-STORE TABLE FILE STORE_DIRECTORY BY STORE_DIRECTORY.STORE_DIRECTORY.STORE_ID NOPRINT BY STORE_DIRECTORY.STORE_DIRECTORY.SECTOR_NAME NOPRINT BY STORE_DIRECTORY.STORE_DIRECTORY.STORE_NAME NOPRINT WHERE STORE_DIRECTORY.STORE_DIRECTORY.SECTOR_NAME EQ '®ION_NAME.().Region:.'; WHERE STORE_DIRECTORY.STORE_DIRECTORY.STORE_NAME EQ '&STORE_NAME.(FIND STORE_DIRECTORY.STORE_DIRECTORY.STORE_NAME IN STORE_DIRECTORY).STORE_NAME:.'; ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * $ ENDSTYLE END -RUN -EXIT $ TYPE=REPORT, WHEN= STORE_NAME EQ 'Missouri', IMAGE=IBFS:/WFC/Repository/untitled/Images/Missouri.jpg,$ TYPE=REPORT, WHEN= STORE_NAME EQ 'Nebraska', IMAGE=IBFS:/WFC/Repository/untitled/Images/nebraska.png,$ TYPE=REPORT, WHEN= STORE_NAME EQ 'Colorado', IMAGE=IBFS:/WFC/Repository/untitled/Images/colorado.png,$ TYPE=REPORT, WHEN= STORE_NAME EQ 'Oklahoma', IMAGE=IBFS:/WFC/Repository/untitled/Images/oklahoma.gif,$ TYPE=REPORT, WHEN= STORE_NAME EQ 'Texas', IMAGE=IBFS:/WFC/Repository/untitled/Images/texas.gif,$ TYPE=REPORT, WHEN= STORE_NAME EQ 'Grocery Store of Kansas', IMAGE=IBFS:/WFC/Repository/untitled/Images/kansasgrocery.gif,$ TYPE=REPORT, WHEN= STORE_NAME EQ 'Grocery Store of Kansas Deli', IMAGE=IBFS:/WFC/Repository/untitled/Images/kansasgrocerydeli.gif,$ ENDSTYLE END -RUN -EXITThis message has been edited. Last edited by: JulieA,
My colleague and I just tested the code again. We think the issue is attributable to how the code is calling the image from the repository based upon the parameter. We changed the name of one the logos to something completely different. It still called up both images for Grocery Store of Kansas but only one image for Grocery Store of Kansas Deli.
Do us a favor -- run with &ECHO=ON and post the STYLE * ... ENDSTYLE section of code that the reporting server echoed. -- Does it retain the IBFS:/WFC/Repository form of reference, or are those image references reworded?
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Hopefully this answers your question as it is one of the lines of code I got when I viewed the source, altered of course for our storage location and our image name.
Thanks again to everyone who assisted me. I'm afraid I don't have much more to offer, and I'll be moving onto a different project.
COMPUTE IMAGE_LOCATION/A100 =
IF COUNTRY EQ 'ENGLAND' THEN 'IBFS:/WFC/Repository/untitled/images/flag_england-flag.png'
ELSE IF COUNTRY EQ 'FRANCE' THEN 'IBFS:/WFC/Repository/untitled/images/france-flag.png'
ELSE IF COUNTRY EQ 'ITALY' THEN 'IBFS:/WFC/Repository/untitled/images/italy-flag.png'
ELSE IF COUNTRY EQ 'JAPAN' THEN 'IBFS:/WFC/Repository/untitled/images/japan-flag.png'
ELSE IF COUNTRY EQ 'W GERMANY' THEN 'IBFS:/WFC/Repository/untitled/images/germany-flag.png'
ELSE ''; NOPRINT
...
TYPE=TABHEADING, IMAGE=(IMAGE_LOCATION), $
COMPUTE IMAGE_LOCATION/A100 =
IF COUNTRY EQ 'ENGLAND' THEN 'test/flag_england.png'
ELSE IF COUNTRY EQ 'FRANCE' THEN 'test/flag_france.png'
ELSE IF COUNTRY EQ 'ITALY' THEN 'test/flag_italy.png'
ELSE IF COUNTRY EQ 'JAPAN' THEN 'test/flag_japan.png'
ELSE IF COUNTRY EQ 'W GERMANY' THEN 'test/flag_germany.png'
ELSE ''; NOPRINT
(I presume "japan-flag.gif" vs "flag_japan.png" is a scribal error)
Interesting. If I read that correctly, the generated HTML file fed to the browser instructs the browser to shout to WF client (WFServlet), to find the graphic file in the Repository and feed it back to the browser.
Looks like Programming has made WFRS smart enough to recognize "IBFS:/WFC/Repository/. . ." when it is spelled out statically in the code, and generate the appropriate call-back -- but not smart enough to handle an indirect IMAGE=(var) when it evaluates to an IBFS:/ reference to an object in Repository.This message has been edited. Last edited by: j.gross,
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
On further thought, I speculate Server has no clue, and just passes the image reference as-is into the HTML code -- while Client is the one endowed with the intelligence to recognize IBFS: references in the fex code and transform
when it prepares the fex for execution by the Server.
But when Client sees
IMAGE=(IMAGE_LOCATION), $
in its scan of the stored code, there is no match to trigger a transformation.
If so, you should be able to feed an indirect reference after all, by mimicking the transformation, like so:
-* your compute:
COMPUTE IMAGE_LOCATION/A100 =
IF COUNTRY EQ 'ENGLAND' THEN 'IBFS:/WFC/Repository/untitled/images/flag_england-flag.png'
ELSE IF COUNTRY EQ 'FRANCE' THEN 'IBFS:/WFC/Repository/untitled/images/france-flag.png'
ELSE IF COUNTRY EQ 'ITALY' THEN 'IBFS:/WFC/Repository/untitled/images/italy-flag.png'
ELSE IF COUNTRY EQ 'JAPAN' THEN 'IBFS:/WFC/Repository/untitled/images/japan-flag.png'
ELSE IF COUNTRY EQ 'W GERMANY' THEN 'IBFS:/WFC/Repository/untitled/images/germany-flag.png'
ELSE ''; NOPRINT
-* embellished reference:
COMPUTE IMAGE_REFERENCE/A200 = '/ibi_apps/WFServlet?IBIMR_drill=IBFS,runItem,' | IMAGE_LOCATION || ',true'; NOPRINT
...
TYPE=TABHEADING, IMAGE=(IMAGE_REFERENCE), $
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
Jack, yes, that does work. Thanks for the sleuthing.
TABLE FILE CAR
SUM
SALES
COMPUTE IMAGE_LOCATION/A100 =
IF COUNTRY EQ 'ENGLAND' THEN 'IBFS:/WFC/Repository/untitled/images/flag_england.png'
ELSE IF COUNTRY EQ 'FRANCE' THEN 'IBFS:/WFC/Repository/untitled/images/flag_france.png'
ELSE IF COUNTRY EQ 'ITALY' THEN 'IBFS:/WFC/Repository/untitled/images/flag_italy.png'
ELSE IF COUNTRY EQ 'JAPAN' THEN 'IBFS:/WFC/Repository/untitled/images/flag_japan.png'
ELSE IF COUNTRY EQ 'W GERMANY' THEN 'IBFS:/WFC/Repository/untitled/images/flag_germany.png'
ELSE ''; NOPRINT
COMPUTE IMAGE_REFERENCE/A200 = '/ibi_apps/WFServlet?IBIMR_drill=IBFS,runItem,' | IMAGE_LOCATION || ',true'; NOPRINT
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE COUNTRY EQ 'JAPAN'
ON TABLE SUBHEAD
""
""
""
""
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=TABHEADING, IMAGE=(IMAGE_REFERENCE), $
ENDSTYLE
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