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     SOLVED-Dynamically Populate an Image Based on a Selection from a Dropdown List

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SOLVED-Dynamically Populate an Image Based on a Selection from a Dropdown List
 Login/Join
 
Platinum Member
posted
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,


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Virtuoso
posted Hide Post
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, 2013Report This Post
Expert
posted Hide Post
Here's one way:

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
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:
<img src="data:image/png;base64," style="position:absolute;top:0pt;left:0pt;">


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Is it not odd that it works when using WF Stylesheet syntax with exactly the same images?


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
OK, just tried it with png files, and the COMPUTE column version still does not work.

Here are png files for your use:







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
Francis --

quote:
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, 2005Report This Post
Expert
posted Hide Post
I don't care how, but the code below works. So referencing an image in the Repository should work in every way we can reference an image.

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Wow! Thank everyone for the feedback and approaches posted herein this forum.

My images are stored in our repository, so I don't think I can change that.

I'll try some of these solutions and update this thread a little later today.


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Platinum Member
posted Hide Post
Francis:

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
-EXIT

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


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Expert
posted Hide Post
quote:
'Grcoery Store of Kansas',

Spellcheck...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
I edited my post.

Thank you, Tom. I appreciate your eye for detail.

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.

Thoughts?


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Expert
posted Hide Post
Hi JulieA,
Try adding spaces after:
 'Grocery Store of Kansas    ',

 


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
It might be better if your WHEN statements use STORE_ID instead of STORE_NAME.


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
Platinum Member
posted Hide Post
Thank you, Tom and Francis, both for your suggestions.

The spaces solution is not a possibility due to specifications given to me for this project.

I might try the idea of using the STORE_ID though. That should do the trick nicely, I think.

Thank you both for your time and expertise!


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Platinum Member
posted Hide Post
Francis: That worked like a charm.

Thank you again!


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Virtuoso
posted Hide Post
quote:
I don't care how, but the code below works.

Julie and Francis:

Great.

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, 2005Report This Post
Platinum Member
posted Hide Post
I'd be happy to do it, but I'm afraid it's not something I've done previously on my own. I tried a few things, but have not yet had luck.

If you can tell me exactly what I would need to do to answer the question of whether the references are retained or reworded, I'll see what I can do.

Thanks again for everyone's help!

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


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Virtuoso
posted Hide Post
1. Add:
-SET &ECHO=ON;
at top of the fex

2. Run as an HTML-output report

3. In resulting webpage, right-click, View source, and search for
ON TABLE SET STYLE *

4. Copy and paste the one of the conditional "IMAGE=" directives to the forum thread

5. reverse any code changes made for #1 and #2
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
No line appears as ON TABLE SET STYLE*

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.


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 191 | Registered: September 18, 2015Report This Post
Expert
posted Hide Post
This code works
TYPE=REPORT, WHEN= COUNTRY EQ 'JAPAN',
IMAGE=IBFS:/WFC/Repository/untitled/images/japan-flag.gif, $
TYPE=REPORT, WHEN= COUNTRY EQ 'JAPAN',
IMAGE=IBFS:/WFC/Repository/untitled/images/flag_japan.png, $
and renders
[IMG]/ibi_apps/WFServlet?IBIMR_drill=IBFS,runItem,IBFS:/WFC/Repository/untitled/images/flag_japan.png,true[/IMG]


This code does not work:
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), $
because it renders:
<span style='vertical-align:top; position:relative'><IMG SRC="data:image/png;base64," style='position:absolute;top:0pt;left:0pt;'></span>


This method works:
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
but very oddly renders
<span style='vertical-align:top; position:relative'><IMG SRC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABECAIAAAD4LAc1AAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAu
MTJDBGvsAAAE40lEQVR4Xu2ba2wUVRTH+6nUKhBN6HappdUg1geWhAajhkTRRGIwRq0BTRU0pFgR
Y6QEE2P1g68PpvrBNJFoYhCXJs2iBoKSothtqQbEB1v2NbPTXfbdB+x2d7uP2Zl6tw8NZ/sauOfO
mtzNL80mk845/9/eO3NnZ7YkHI64XAJnbkTyV3Q6h4KhkgsXBjxej5e/5n55PIOiKB4xm0sEt6Sq
6oQ6wZkHOSebOju5rEUxLUuUuKyF4bI0wGVpgMvSAJelAS5LA1yWBrgsDXBZGuCyNFBEstRUOucP
pX77M37sxFjX9zGTOX70RKrvjOzxKYnxYvgs9ZeVGxqJHTIHn29x33W/48ZaW5nRtqRihhW2skr7
8mrxtvX+xhejB76WLwYmFN2s6SaLlMsMOEMtrc7KOlupgUhZmCUVjptuCWxrHrecUXMK2CED9JGV
Cw+HXtlnX1ptK1ucJojR/9SOrFMCu8WGtSxSJf7dD8KqtYsdTXNDRtnlz75ScjlQAg+mskiw4bc/
spUbQeyrp9QQbNqtJJKgEBLsZKmZbHDna1c77+am1OB9tFGJjoFyGLCSJedCLXvpm5rG4Nv8rBJP
wKK0mZYl5GXJYBtFRts78msCGJImoV17sU+RMyPL7carNN5/1rGcLKBgPLrYy6tih7pAabpks5Oy
3JJ7QoHbqKCmM4MbHgHBkBBq6+XQEGiAItOyyDELbKBF9Itv0A5VhRgi+94BDVCEnM1Nhw9jySLD
Sqy7tyASIs6KNblgBLRBC1xZiWM/XfviUyOG0U87QBu0yE9DJFlkLRJ4ZmdBGHSkhk1IJytEWWRh
7Vp5N0jCgnKj7PWDZqiAKCt9zsp8Dk5hiJnMoBkqIMqKHezSSVblUNsHoBkqIMoaebed4aLhCgLb
XwbNUAFRVuT1NpCBGb4nmkAzVECUFdrVCjIww/vwk6AZKiDKGt7/PsjADH/jDtAMFRBlXW4/oNcx
K/RqK2iGCoiyEke79TobjrajLOIRZcken/26KhCDCYbkSQtohgqIsshlp1T/YEESdBwrVqtxlG/l
EWURht/6ECRhgH/rS6ANWuDKyjolmvdyFoUhfrwbtEELXFmqqvqffqEgDyJSw0NqJgvaoAWuLEL6
97/tN7A7zMdMR0ADFEGXRQjv2Q8iIXHxsa1KFvEe1YwsUcS7u6Ncikr1G0Ew6rhW3plxiKA0XYis
zsmRJSoq4k239F9WZ8UaEI8ijqU18W+Pg6LU+W9kocoiJE/2kBUQCEkF+/U3Rz8/CMphQOY4k9v3
kyS7e5zGO0DUa8SxrCb6pYlB8wSmsggZq0Nav4nWNaNQsw7pymZWmD5yNIUyFo+80WZftgok14gx
sK1ZDoTBzlHRQRaB1EqfO+97vIkcbgosLIC9vMrzwJbEj7+wf1JSH1lTkLTpPwbCe94UVzfkRcwz
Nyc3uarXBrfvTp46jbqYmgc9Zf2LEk+kTp+99HEHceHZuEWs2yDcuk6ovUe4vcFz3+bAc80j732S
/LmPrNfAPzKmKGRdgaKSizt1PJV/9p28YT7X5qH4ZBUxXJYGuCwNcFka4LI0wGVpgMvSAJelAS5L
A1yWBmZkud2qyu63aP9T8l8rE1mCNJjNphRV4cyKrMpKLpNIpzuJrPNWq6XXYunr48xOb29vj+WU
pae//9d/AB2BPoKSZTY6AAAAAElFTkSuQmCC
" style='position:absolute;top:0pt;left:0pt;'></span>


Why can't it just work properly?

This message has been edited. Last edited by: Francis Mariani,


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
"This code works
TYPE=REPORT, WHEN= COUNTRY EQ 'JAPAN',
IMAGE=IBFS:/WFC/Repository/untitled/images/japan-flag.gif, $ 

and renders
[IMG]/ibi_apps/WFServlet?IBIMR_drill=IBFS,runItem,IBFS:/WFC/Repository/untitled/images/flag_japan.png,true[/IMG]


(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, 2005Report This Post
Expert
posted Hide Post
Jack, that was a copy/paste mistake (now corrected).

To summarize: WFRS: smart. Programming: not so much.


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
There is still hope.

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
    IMAGE=IBFS:/WFC/Repository/{whatever}, $

in the stored fex to
    IMAGE='/ibi_apps/WFServlet?IBIMR_drill=IBFS,runItem,IBFS:/WFC/Repository/{whatever},true',$

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, 2005Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     SOLVED-Dynamically Populate an Image Based on a Selection from a Dropdown List

Copyright © 1996-2020 Information Builders