Home » Developer & Programmer » Reports & Discoverer » how to trap rep-0108
how to trap rep-0108 [message #197680] Thu, 12 October 2006 05:07 Go to next message
lancer26
Messages: 52
Registered: May 2006
Location: Pakistan
Member

aoa to all!
Dear gurus, i want to develop such type of report in report builder 6i.

empno employee name emp photo
1 abc (here i want to show photo)

i have build such report but the problem is when any employee who has no photo, i want to display default photo. i m displaying photo using the below steps
1. create a formula column of type char which returns the path of emp photo like this ' return 'd:\photo\' || :empno || '.gif';
2.create a field in layout and set the read from file property set to yes and format to image.
my requirement is when a new employee record is entered into table emp but his photo is not currently in the directory then i want to display a logo.
hope my question is clear. thanks in advance. plz reply a.s.a.p
Re: how to trap rep-0108 [message #198412 is a reply to message #197680] Tue, 17 October 2006 02:14 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Before returning the filename, you can cross check whether the file is present in the path or not by opening it in read mode.

If it is succeeded, close the file and return the filename.
If it's error out then (in exception section) you can return the filename as logo.gif or so.

If that is not working, then please provide the rdf.

By
Vamsi.
Re: how to trap rep-0108 [message #198456 is a reply to message #197680] Tue, 17 October 2006 04:27 Go to previous messageGo to next message
imen_mr2004
Messages: 22
Registered: October 2006
Location: tunisia
Junior Member
hi
u can put a formula column and put a select statement


var_photo varchar2(50)
select photo into var_photo from emp where empno=:empno;
return var_photo;
exception when no_data_found then return 'C:\logo.gif';(exemple of path)
Re: how to trap rep-0108 [message #198470 is a reply to message #198456] Tue, 17 October 2006 05:03 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Quote:
my requirement is when a new employee record is entered into table emp but his photo is not currently in the directory then i want to display a logo.


I have no idea whether there is a column photo in the table emp or not.
I think the photo(the image file, which is in the format empno.gif) is not present in the directory.

So, If empno is not there in the table emp, there is no question of showing an image, because the report is expected to print only the records in the table.

If at all there is a column photo and it is having null, then it won't raise no_data_found. So, the following condition should be there instead of no_data_found.

IF var_photo IS NULL THEN

Or else follow my previous solution.

By Vamsi.
Re: how to trap rep-0108 [message #276101 is a reply to message #198412] Wed, 24 October 2007 00:01 Go to previous messageGo to next message
faisalit
Messages: 2
Registered: May 2007
Location: Faisalabad Pakistan.
Junior Member
vamsi kasina wrote on Tue, 17 October 2006 12:14

Before returning the filename, you can cross check whether the file is present in the path or not by opening it in read mode.

If it is succeeded, close the file and return the filename.
If it's error out then (in exception section) you can return the filename as logo.gif or so.

If that is not working, then please provide the rdf.

By
Vamsi.



how can we cross check(what are the function to use this purpose) whether the file is present in the path or not by opening in read mode in by using oracle report developer.

plz reply me at following address

sarfraz_shafi@yahoo.com

i will be thankful to you in advance

[Updated on: Wed, 24 October 2007 00:03]

Report message to a moderator

Re: how to trap rep-0108 [message #276127 is a reply to message #276101] Wed, 24 October 2007 01:32 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Very old post. Razz
Quote:

you can cross check whether the file is present in the path or not by opening it in read mode.
I think I meant to say, use UTL_FILE to open the file in read mode. If it is erring out, then get that in exception handler and do the needful.

By
Vamsi
Previous Topic: DRILL DOWN REPORTS
Next Topic: ser no
Goto Forum:
  


Current Time: Sun Dec 11 08:29:35 CST 2016

Total time taken to generate the page: 0.09658 seconds