Home » Developer & Programmer » Reports & Discoverer » image problem in reports (Reports 6i)
image problem in reports [message #354948] Wed, 22 October 2008 01:08 Go to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
hi everyone,

i have displayed images using formula column in my my report from file system by specifying 'read from file to YES and File type to IMAGE. now the problem is , if the image does not found. it gives me the error at runtime and the report ends and no output shown. i dont find any method to specify and alternate path to give it, in otder to show any other image.

i hope you people understand my problem.


Thanks and regards

Athar
Re: image problem in reports [message #356200 is a reply to message #354948] Wed, 29 October 2008 23:22 Go to previous message
ambreensh
Messages: 20
Registered: December 2007
Location: Karachi
Junior Member
create function in Report Builder
with name find_file . The code for find_file function given below

-----------------------------------------------------------
FUNCTION find_file( p_filename varchar2 ) RETURN VARCHAR2 is
in_file TEXT_IO.FILE_TYPE;
BEGIN
in_file := TEXT_IO.FOPEN(p_filename, 'r');
TEXT_IO.FCLOSE(in_file);
RETURN 'present';
EXCEPTION
WHEN NO_DATA_FOUND THEN
TEXT_IO.FCLOSE(in_file);
RETURN 'absent' ;
WHEN OTHERS then
RETURN 'absent' ;
END;

---------------------------------------------------------------

in formula column write code as shown below

function CF_imageFormula return Char is
image_path varchar2(200);
fileexists varchar2(20);
begin
select logopath into image_path from dracad.institute;
fileexists:=find_file(image_path);
if fileexists='present' then

return (image_path);
else
return(null);
end if;
end;





Previous Topic: display multiple records
Next Topic: syntax error
Goto Forum:
  


Current Time: Sat Nov 30 05:39:07 CST 2024