Focal Point
[SOLVED] Dynamic Image not appearing on SUBHEAD

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/804105491

July 29, 2009, 03:15 PM
malapejohn
[SOLVED] Dynamic Image not appearing on SUBHEAD
Subject MRE Report.
Images reside on Other Folder in MRE domain.

Here is my code.
In the subhead attribute of the stylesheet if I entered a field such as
IMAGE=(JJ)
then the image does not appear
else if I enter the image itself like this
IMAGE=app/qc_en.gif,
then it works and shows up on report on the SUBHEAD

Can anyone help ? ideas


SET ASNAMES=ON
ENGINE SQLMSS SET DEFAULT_CONNECTION DV1
SQL SQLMSS PREPARE SQLOUT FOR
SELECT KUNNR, REGIO
FROM KNA1
WHERE KUNNR = '0000002035'
OR KUNNR = '0000001001'
;
END
-*
DEFINE FILE SQLOUT
JJ/A20='app/qc_en.gif';
END
-*
TABLE FILE SQLOUT
PRINT JJ NOPRINT
BY REGIO
BY KUNNR
ON REGIO SUBHEAD
"ON TABLE HOLD AS HOLD1
END
TABLE FILE HOLD1
PRINT JJ
BY REGIO
BY KUNNR
ON REGIO SUBHEAD
"ON REGIO SUBFOOT WITHIN
" "
HEADING
""
FOOTING
""
ON TABLE SUBFOOT
""
ON TABLE NOTOTAL
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
TYPE=SUBHEAD,
IMAGE=(JJ),
$
ENDSTYLE
END

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


-PMF 5.1.2
-WebFOCUS 7.6.9 on Windows 2003 Server
-MSSQL Server
July 29, 2009, 05:13 PM
PBrightwell
What happens if you remove the parens? What happens if you define the string as an &Variable instead of in a define?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
July 30, 2009, 09:17 AM
Doug
There seems to be a lot of missing double-quotes in yur code. Perhaps that's just due to a copy-and-apste, try enclosing your code within the code tags. Anyway, here's something that actually works, including the use of "ALT":
TYPE=HEADING, IMAGE=BWCHUBB.GIF, POSITION=(0 0), SIZE=(1.00 0.75),
ALT='Chubb Global Reinsurance Reporting System',$

Note no parens, as Pat mentioned.
July 30, 2009, 09:22 AM
malapejohn
Thanx for the feedback.
If the variable is stored in dialogue manager it works. If the variable is stored in a define it does not work, and of course I removed the paren. Any ideas. This is an example I found from the book.

thx John


-PMF 5.1.2
-WebFOCUS 7.6.9 on Windows 2003 Server
-MSSQL Server
July 30, 2009, 09:27 AM
malapejohn
The book meaning Creating Webfocus Reporting book.


-PMF 5.1.2
-WebFOCUS 7.6.9 on Windows 2003 Server
-MSSQL Server
July 30, 2009, 09:35 AM
Francis Mariani
Following the instructions in the manual, I can't get the dynamic image (based on a report column) to work either.

I just found this documentation (WebFOCUS Managed Reporting Developer's Manual > Working With Domains and Standard Reports > Importing Procedures and Other Files Into WebFOCUS):
quote:
Images that are imported into the Managed Reporting Repository are only utilized by preview options in WebFOCUS and Developer Studio report and graph development tools. When images in Other Files are referenced in WebFOCUS procedures or StyleSheet references, the images must be accessible to the WebFOCUS Reporting Server when a report is run or from the web/application server when a report is viewed by a user. The specific location of the image is dependent upon the syntax used to reference the image. For more information about images, see Adding an Image to a Report in the Laying Out the Report Page chapter of the Creating Reports With WebFOCUS Language manual.


This might help resolve the problem (Creating Reports With WebFOCUS Language > Laying Out the Report Page > Adding an Image to a Report > Specifying a URL):
quote:
The following guidelines are the same for IMAGE=url and IMAGE=(column) syntax. In the latter case, they apply to a URL stored in a data source field.

Specify a URL by:

Supplying an absolute or relative address that points to an image file, for example:
- TYPE=TABHEADING,IMAGE=http://www.ibi.com/images/logo_wf3.gif,$
- TYPE=TABHEADING, IMAGE=/ibi_html/ggdemo/gotham.gif,$
- Using the SET BASEURL parameter to establish a URL that is logically prefixed to all relative URLs in the request. With this feature, you can add an image by specifying just its file name in the IMAGE attribute. For example:

SET BASEURL=D:\ibi\apps\SESSION\
.
.
.
TYPE=REPORT, IMAGE=gotham.gif,$

The following apply:
- A base URL must end with a slash (/).
- An absolute URL (which begins with http://) overrides a base URL.
- A URL is case-sensitive when referring to a UNIX server.
- If the name of the image file does not contain an extension, .GIF is used.


And, you're quite right about using brackets when the image name is stored in a report column.


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
July 30, 2009, 11:32 AM
malapejohn
This was a little frustrating , I found an alternative. I created a define field and had the img src point to an application folder on the reporting server. Then I used that variable directly underneath the SUBHEAD keyword not in the stylesheet and that worked great! Thanx for your help


-PMF 5.1.2
-WebFOCUS 7.6.9 on Windows 2003 Server
-MSSQL Server
July 30, 2009, 11:35 AM
Darin Lee
Francis already dug up a reference to what I was thinking. My understanding is that any images referenced must be available to the application server. They can't exist only in the Manager Reporting environment. The WF server has no way of going back to the WF Client to dig through the MRE folders to find a referenced image.

Try moving those images to the baseapp (or other directory in the app path) and they should work. If you are not doing any logic to determine which image is to be used (e.g. the same logo for every page), it's best to hard code (or use &variable) so it doesn't have to create that value for every record retrieved into the internal matrix. Just an efficiency issue. In this case, as you have found, the parens are not used. If you are determining the image/logo to be used based on a record value, use the fieldname enclosed in parens.


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
July 30, 2009, 11:45 AM
Francis Mariani
I placed an image in baseapp, but I can't get an MRE fex to have it display properly when the image file name is in a column:

-SET &ECHO=ALL;

SET BASEURL=http://localhost:8080/approot/baseapp/

DEFINE FILE CAR
IMG1/A20 WITH CAR = 'yellow3_u.gif';
END

TABLE FILE CAR
SUM
SALES
BY COUNTRY
ON COUNTRY SUBHEAD
" "
ON COUNTRY SUBFOOT
" "

ON TABLE SET STYLE *
TYPE=SUBHEAD, IMAGE='yellow3_u.gif', $
TYPE=SUBFOOT, IMAGE=(IMG1), $
ENDSTYLE
END

This fex results in this mess:

 SET BASEURL=http://localhost:8080/approot/baseapp/
 DEFINE FILE CAR
 IMG1/A20 WITH CAR = 'yellow3_u.gif';
 END
 TABLE FILE CAR
 SUM
 SALES
 BY COUNTRY
 ON COUNTRY SUBHEAD
 " "
 ON COUNTRY SUBFOOT
 " "
 ON TABLE SET STYLE *
 TYPE=SUBHEAD, IMAGE='yellow3_u.gif', $
 TYPE=SUBFOOT, IMAGE='/ibi_apps/WFServlet?IBIMR_drill=P,(img1).gif,francism/francism.htm', $
 ENDSTYLE
 END
 (FOC3202) BAD VALUE IN STYLESHEET FILE AT LINE 2:
 IMAGE=/ibi_apps/WFServlet?IBIMR_drill=P,(img1).gif,francism/francism.htm

When I comment the Subfoot styling, the report properly display the Subhead image.


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
July 30, 2009, 01:05 PM
Darin Lee
Francis,

You've got to have the defined field containing the image name as a verb object. Add IMG1 NOPRINT to your SUM and it should work.


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
July 30, 2009, 01:35 PM
Francis Mariani
Darin, thanks for spotting my silly mistake - the programs works after the correction.

Thanks,


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