Home » Developer & Programmer » Reports & Discoverer » if :pict not found then return (false)
if :pict not found then return (false) [message #249877] Fri, 06 July 2007 06:37 Go to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
SELECT '*'||a.Employee_code||'*' AS "BARCODE", a.Employee_code,
'D:\Pictures\'||a.employee_code||'.bmp' as pict,a.job_status,
a.Employee_name, a.Designation_desc,a.new_nic_no,
a.COMPANY_CODE, b.company_name,b.ADDRESS,
a.location_code, c.location_name,
a.department_code, d.department_name,
e.division_code, division_name
FROM Employees a,
company b,
locations c,
departments d,
divisions e
where a.company_code = b.company_code
and a.location_code = c.location_code
and a.department_code = d.department_code
and a.employee_code between :eno and :sno
and e.division_name = :div
and a.division_code = e.division_code
and a.department_head = 'N'


I used this query for print ID card it is working fine but one problem is here that if I dont have picture of any employee then report gives the error that "Picture not found" I want that if picture not found in d:\pictures then only show the blank space instead of message.
Re: if :pict not found then return (false) [message #249881 is a reply to message #249877] Fri, 06 July 2007 07:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
With "report" do you mean Oracle Reports or a custom report.
In the later, don't display the message.
In the former, we will transfer this topic to the Reports forum.

Regards
Michel

Re: if :pict not found then return (false) [message #249883 is a reply to message #249881] Fri, 06 July 2007 07:11 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
I am talking about Oracle Report 6i
Re: if :pict not found then return (false) [message #249897 is a reply to message #249883] Fri, 06 July 2007 08:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
So I move the topic.

Regards
Michel
Re: if :pict not found then return (false) [message #250020 is a reply to message #249897] Sat, 07 July 2007 01:00 Go to previous message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
used Formula column and write there these code

function CF_1Formula return Char is

l_filename text_io.file_type;
BEGIN
l_filename := text_io.fopen ('.\D:\Pictures\' || :pict, 'r');
text_io.fclose (l_filename);
RETURN :pict;
EXCEPTION
-- the report photo doesn't exist
WHEN OTHERS THEN
BEGIN
l_filename := text_io.fopen ('.\D:\Pictures\default_image.jpg', 'r');
text_io.fclose (l_filename);
RETURN 'default_image.jpg';
EXCEPTION
-- the report photo 'default_image.jpg' doesn't exist
WHEN OTHERS THEN RETURN NULL;
END;
END;

but here every picture is showing its default picture(empty) although I have some picture in said folder.
Previous Topic: problem in "generate to delimited" ...
Next Topic: report error
Goto Forum:
  


Current Time: Tue Nov 26 18:49:24 CST 2024