if :pict not found then return (false) [message #249877] |
Fri, 06 July 2007 06:37 |
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 #250020 is a reply to message #249897] |
Sat, 07 July 2007 01:00 |
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.
|
|
|