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] Dynamic image files in row data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Dynamic image files in row data
 Login/Join
 
Member
posted
Hello All,

I'm creating a report that displays student details (school,name,id, etc.), and I've been asked to display the students photo.

Student data is in Oracle, photographs are stored on a network drive as student_id.jpg (123.jpg, 987.jpg).

I've reviewed the on-line help "Adding an Image to a Report." My needs closely match the example about using a BLOB field in a Report column. I differ, obviously, on using files not fields.

Any insight on how to adapt that example, or pointing me in the right direction is greatly appreciated.

Thanks.

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


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
 
Posts: 21 | Registered: August 26, 2009Report This Post
Expert
posted Hide Post
Depends on the report format - different syntax is used to include images in HTML and PDF reports.

Here's some reading: Image in row of a PDF report

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
Member
posted Hide Post
Francis,

Thanks for the lightning fast response.

I've re-read that post and I'm still a little confused about how to apply it to my situation.

Question 1:
 TYPE=DATA, COLUMN=N3, IMAGE=(LOGO),SIZE=(2.0 .5),$ 


What is the column reference, I've seen N3's and P4's used in other examples. What do those values mean? I've tried searching for documentation but haven't found the right search terms to self-educate.

Question 2:
DEFINE FILE CAR
LOGO/A15=IF COUNTRY EQ 'ENGLAND' THEN 'IMAGE1' ELSE 
         IF COUNTRY EQ 'ITALY' THEN 'IMAGE2' ELSE 'IMAGE3';
END


Should I include the full file path to the student images as part of the LOGO compute? Or as part of the TYPE=DATA?


My current code is:
TABLE FILE DTBL_STUDENTS
PRINT 
     COMPUTE STUDENT_IMG/A100V = 'J:\photos\' || DTBL_STUDENTS.DTBL_STUDENTS.STUDENT_ID || '.JPG';
     'DTBL_STUDENTS.DTBL_STUDENTS.STUDENT_NAME'
     'DTBL_STUDENTS.DTBL_STUDENTS.STUDENT_CURRENT_GRADE_CODE'
BY 'DTBL_STUDENTS.DTBL_STUDENTS.STUDENT_ID'
HEADING
""
FOOTING
""
WHERE DTBL_STUDENTS.DTBL_STUDENTS.STUDENT_ID EQ '1227731' OR '723252' OR '1226906';
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=9,
$
TYPE=DATA,COLUMN=C5,
     IMAGE=(STUDENT_IMG),
     SIZE=(2.000000 5.000000),


Produces the following:

   
STUDENT_ID STUDENT_IMG STUDENT_NAME STUDENT_CURRENT_GRADE_CODE 
1226906 J:\photos\1226906.JPG Student Name 09 
1227731 J:\photos\1227731.JPG Student Name 09 
723252 J:\photos\723252.JPG Student Name 12 


No photos, no error messages.

Thanks again for looking!

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


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
 
Posts: 21 | Registered: August 26, 2009Report This Post
Expert
posted Hide Post
Question 1, these are column references.

N - The column number from the left.
B - The By field column number
P - The column number from the left Not including NOPRINTS.

Question 2.
For HTML you need a web location to the images, for PDF the images need to be in the path. so WebFOCUS can attach the image (Include) to the PDF document.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
PDF example:

-* File fmtest1.fex

DEFINE FILE CAR
COUNTRYX/A10 = IF COUNTRY EQ 'W GERMANY' THEN 'GERMANY' ELSE COUNTRY;
FLAG_IMG/A40 = LOCASE(10, COUNTRYX, 'A10') || '_flag_s';
END

TABLE FILE CAR
SUM
COUNTRY
SALES

FLAG_IMG NOPRINT

BY COUNTRY AS ''

ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON,
FONT='ARIAL', SIZE=8,
BORDER=1, BORDER-COLOR=SILVER,
$
TYPE=DATA, COLUMN=COUNTRY(1), IMAGE=(FLAG_IMG), $
ENDSTYLE

ON TABLE PCHOLD FORMAT PDF
END

HTML example:
-* File fmtest2.fex

DEFINE FILE CAR
COUNTRYX/A10 = IF COUNTRY EQ 'W GERMANY' THEN 'GERMANY' ELSE COUNTRY;
FLAG_IMG/A40 = LOCASE(10, COUNTRYX, 'A10') || '_flag_s';
END

TABLE FILE CAR
SUM
COMPUTE FLAG/A100 = '<img src="/approot/baseapp/' || FLAG_IMG || '.gif" />'; AS ''
COUNTRY
SALES

FLAG_IMG NOPRINT

BY COUNTRY NOPRINT

ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON,
FONT='ARIAL', SIZE=8, $
ENDSTYLE

END


For PDF, images must be in the Application Path on the reporting server. Put the images in Application Folder baseapp.

For HTML, images must be available to the web server. Put the images in baseapp on the web server approot directory. Usually (in a single tier environment) this folder is the same as the reporting server application folder.

Images available here:

Flag 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
I'm not sure if there's a nice and neat way to do this for both HTML and PDF, other than using Dialogue Manager to bypass certain lines of code depending on which format was selected.


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
quote:
Student data is in Oracle, photographs are stored on a network drive as student_id.jpg (123.jpg, 987.jpg).

  
1. 'J:\photos\' || DTBL_STUDENTS.DTBL_STUDENTS.STUDENT_ID || '.JPG' means the photos are on the J Drive of the
                                                                    Reporting Server in the APP Folder photos.
    1a. If they are not actually on the Reporting Server J Drive, see next idea.
2. APP MAP to the Network Drive that houses the images via edasprof.prf (best way to do it)
    2a. May need the actual IP address.
3. FTP "ALL" images to the Reporting Server, into an Application folder (worst case)
    3a. The Reporting Server has no idea where these images are...
4. Wouldn't you have to JOIN the Student_ID from ORACLE to the STUDENT_ID on the J Drive to get the correct picture 
   with the correct student? Maybe not...

Here is an example post of what "I" have done to get images in PDF/PPT formats...

hth

Tom

This message has been edited. Last edited by: Tom Flynn,


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 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     [CLOSED] Dynamic image files in row data

Copyright © 1996-2020 Information Builders