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] Using Default Image if Image Not Found

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Using Default Image if Image Not Found
 Login/Join
 
Gold member
posted
I have a compound PDF report that prints a student profile for up to 150 students. A report consists of several pages for each student, and a student picture appears on the first page of each report.

Each picture is a jpg, and is identified by the student id.

Currently, if a picture is not found for a student, nothing displays on the profile report.

There is a default picture, called 'notfound.jpg'. I would like to display 'notfound.jpg' if a picture is not found for a particular student.

My question is - what options do I have to enable this?

These are the steps I am considering:

1 - develop the jpg name for all selected students
2 - do a CMD STATE for each file to determine existence of image
3 - write results to a hold file, using 'notfound.jpg' as the image name if it doesn't exist. Otherwise, use the actual image name
4 - join the hold file to the report file at presentation and use the image file in the stylesheet as I am currently doing.

This is doable, but I would like to see what other options there are to do this, especially if not quite so involved.

Thanks!

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


WebFOCUS 8
 
Posts: 74 | Location: Gahanna, OH | Registered: September 22, 2009Report This Post
Guru
posted Hide Post
It may help.
-* File COMPOUND.fex
-* Default Mode: ResourceLayout
SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='0.5^0.5^0.5^0.5^1', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter, SHOW_GLOBALFILTER=OFF, $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(1.875 1.042), DIMENSION=(4.792 2.813), METADATA='HEIGHT: 2.813in; POSITION: absolute; LEFT: 1.875in; Z-INDEX: 100; TOP: 1.042in; WIDTH: 4.792in', $
END
SET COMPONENT='report1'
-*component_type report
APP HOLD BASEAPP
TABLE FILE CAR
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE
END
-RUN
-SET &C=&LINES;
-REPEAT #GIFS FOR &I FROM 1 TO &C;
-READ SAVE,&COUNTRY.&I
GRAPH FILE CAR
SUM RETAIL_COST AS ''
ACROSS MPG AS ''
WHERE COUNTRY EQ '&COUNTRY.&I';
ON GRAPH SET LOOKGRAPH VLINE
ON GRAPH SET HAXIS 150
ON GRAPH SET VAXIS 25
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID OFF
ON GRAPH HOLD AS SPARK&I FORMAT GIF
ON GRAPH SET GRAPHSTYLE *
setMarkerDisplay(false);
setConnectLineMarkers(true);
setConnectScatterMarkers(true);
setO1LabelDisplay(false);
setO1AxisSide(0);
setO1MajorGridDisplay(false);
setO1MajorGridStyle(0);
setO1MinorGridDisplay(false);
setAxisAssignment(0,0);
setSeriesType(0,2);
setY1LabelDisplay(false);
setY1AxisSide(0);
setY1MajorGridDisplay(false);
setY1MajorGridStyle(0);
setY1MinorGridDisplay(false);
setTextFormatPreset(getY1Label(),-1);
setTextFormatPattern(getY1Label(),"#.##");
setPieFeelerTextDisplay(1);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),1);
setRiserBorderMode(0);
setSeriesDefaultTransparentBorderColor(false);
setUseSeriesBorderDefaults(false);
setLegendDisplay(false);
setFontSizeAbsolute(getY1Title(),true);
setFontSizeAbsolute(getY1Label(),true);
setFontSizeAbsolute(getY2Title(),true);
setFontSizeAbsolute(getY2Label(),true);
setFontSizeAbsolute(getO1Title(),true);
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
$
ENDSTYLE
END
? FILEDEF
-#GIFS
DEFINE FILE CAR
FLAG/A100 = DECODE COUNTRY ('ENGLAND' 'spark1.gif' 'FRANCE' 'spark2.gif' 'ITALY' 'spark3.gif' 'JAPAN' 'spark4.gif' 'W GERMANY' 'spark5.gif');
END
TABLE FILE CAR
SUM RETAIL_COST FLAG
BY COUNTRY
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
type=data, column=N3, image=(flag), size=(3.0 .25), preserveratio=on,$
ENDSTYLE
END
END
COMPOUND END
 


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Expert
posted Hide Post
Can you just query the list of images. (Assumes the jpg's are in the path)

{APP MAP PICS ... (if needed)}
{APP APPENDPATH PICS (if needed)}
APP QUERY PICS HOLD
TABLE FILE FOCAPPQ
PRINT FILENAME
COMPUTE STUD_ID/A70 = GETTOK(FILENAME,70,1,'.',70,'A70') ;
COMPUTE FILE_EXT/A70 = GETTOK(FILENAME,70,-1,'.',70,'A70') ;
ON TABLE HOLD AS STUDPICS
WHERE TOTAL FILE_EXT EQ 'jpg'
END


At this stage the list of photos is in a hold file and is near to a point where it can be joined to, to check the existence.


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
Gold member
posted Hide Post
Rifaz and Waz,

Thank you for your suggestions! They look very promising! I will update this post with my results.


WebFOCUS 8
 
Posts: 74 | Location: Gahanna, OH | Registered: September 22, 2009Report This Post
Gold member
posted Hide Post
Waz,

I was able to use your suggestion about querying the list of images for my solution.

Here is my code:

-* Get student ids
TABLE FILE BTCH_STUD_LIST
PRINT STUD_ID_ALPHA
   BY STUD_ID_ALPHA NOPRINT
ON TABLE HOLD AS STUDENTS
END
-RUN

APP APPENDPATH CCSPHOTOS
APP QUERY CCSPHOTOS HOLD
TABLE FILE FOCAPPQ
PRINT STUD_ID_INT
      FILENAME 
   BY STUD_ID
WHERE STUD_ID IN FILE STUDENTS
ON TABLE HOLD AS STDPICS 
END
-RUN

JOIN STUD_ID_ALPHA IN STUDENTS TO STUD_ID IN STDPICS AS J1
DEFINE FILE STUDENTS
STUDENT_IMAGE/A200 = IF FILENAME EQ ' ' THEN 'notfound.jpg' ELSE FILENAME;
STUD_ID_KEY/I8     = EDIT(STUD_ID_ALPHA);
END
TABLE FILE STUDENTS
PRINT STUDENT_IMAGE
   BY STUD_ID_KEY
ON TABLE HOLD AS PICFILES FORMAT XFOCUS INDEX STUD_ID_KEY
END
-RUN


I then join PICFILES to my reporting file and use STUDENT_IMAGE to show the picture for each student.

Thanks for the assistance!


WebFOCUS 8
 
Posts: 74 | Location: Gahanna, OH | Registered: September 22, 2009Report 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] Using Default Image if Image Not Found

Copyright © 1996-2020 Information Builders